Bug 28833: Speed up holds queue builder via parallel processing
authorKyle M Hall <kyle@bywatersolutions.com>
Mon, 9 Aug 2021 17:46:00 +0000 (13:46 -0400)
committerKyle M Hall <kyle@bywatersolutions.com>
Tue, 10 Aug 2021 11:05:15 +0000 (07:05 -0400)
commit08ad241ab510350d44673376c28d853a328a4ec5
treee97622e566ae4b7fa429e915b4d0b464acd160ee
parent72213935f3383833e4ea5842ab00483999fb0d1f
Bug 28833: Speed up holds queue builder via parallel processing

The holds queue builder can take a very long time to run on systems with many holds. For example, a partner with 124,784 unfilled ( not found ) holds, is taking about 64 minutes to run. If we run that same number of holds in 5 parallel chunks ( splitting the number of records as evenly as possible, but *not* taking into account the holds per bib ), it takes 21.5 minutes. If we use 10 loops, it takes less then 14 minutes.

Test Plan:
1) Generate a huge number of holds ( a few thousand at the minimum )
2) Run the holds queue builder, use the `time` utility to track how much
   time it took to run
3) Set HoldsQueueParallelLoopsCount to 10
4) Repeat step 2, note the improvement in speed
5) Experiment with other values for HoldsQueueParallelLoopsCount
6) prove t/db_dependent/HoldsQueue.t
C4/HoldsQueue.pm
installer/data/mysql/atomicupdate/bug_28833.perl [new file with mode: 0644]
installer/data/mysql/mandatory/sysprefs.sql
koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/circulation.pref