Koha-clms/Koha/BackgroundJob
Kyle M Hall 6d30ead414
Bug 43103: Switch OR chains to INs for batch item modification and patron deletion
Three searches pass large ID lists:
* Koha::BackgroundJob::BatchUpdateItem passes every itemnumber of the
  batch, and batch item modifications can cover tens of thousands of
  items
* Koha::Items::batch_update does the same with the modified
  itemnumbers when collecting biblionumbers for reindexing
* Koha::Patrons::filter_by_safe_to_delete does it with the
  borrowernumbers found safe to delete ( unlikely to approach
  the same numbers as items/bibs, but still good to fix )

This patch switches all three to IN. The lists are still passed as
values, but the query stays a flat IN list the optimizer handles well
instead of a chain of ORs that can't be optimized.

Test Plan:
1) Apply this patch
2) prove t/db_dependent/Koha/Items/BatchUpdate.t
3) prove t/db_dependent/Koha/Patrons.t
4) Note all tests pass!

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Emily Lamancusa <emily.lamancusa@montgomerycountymd.gov>
Signed-off-by: Pedro Amorim <pedro.amorim@openfifth.co.uk>
2026-07-31 13:40:31 +00:00
..
BatchCancelHold.pm Bug 40163: Fix several http addresses in the code docs 2025-09-23 16:21:29 -06:00
BatchDeleteAuthority.pm Bug 38664: Tidy the whole codebase 2025-02-11 14:58:24 +01:00
BatchDeleteBiblio.pm Bug 38664: Tidy the whole codebase 2025-02-11 14:58:24 +01:00
BatchDeleteItem.pm Bug 40163: Fix several http addresses in the code docs 2025-09-23 16:21:29 -06:00
BatchUpdateAuthority.pm Bug 40163: Fix several http addresses in the code docs 2025-09-23 16:21:29 -06:00
BatchUpdateBiblio.pm Bug 40163: Fix several http addresses in the code docs 2025-09-23 16:21:29 -06:00
BatchUpdateBiblioHoldsQueue.pm Bug 42489: Pass unallocated mode to real-time holds queue 2026-07-27 12:12:47 +00:00
BatchUpdateItem.pm Bug 43103: Switch OR chains to INs for batch item modification and patron deletion 2026-07-31 13:40:31 +00:00
CreateEHoldingsFromBiblios.pm Bug 40163: Fix several http addresses in the code docs 2025-09-23 16:21:29 -06:00
ErmSushiHarvester.pm Bug 40163: Fix several http addresses in the code docs 2025-09-23 16:21:29 -06:00
ImportKBARTFile.pm Bug 40163: Fix several http addresses in the code docs 2025-09-23 16:21:29 -06:00
MARCImportCommitBatch.pm Bug 40846: Improve handling of ignored records 2026-01-21 07:44:20 -07:00
MARCImportRevertBatch.pm Bug 40163: Fix several http addresses in the code docs 2025-09-23 16:21:29 -06:00
PseudonymizeStatistic.pm Bug 42396: Adjust 'use' statements 2026-07-27 15:53:23 +00:00
StageMARCForImport.pm Bug 40163: Fix several http addresses in the code docs 2025-09-23 16:21:29 -06:00
TestTransport.pm Bug 40163: (follow-up) Fix wrong GNU links and update test 2025-09-24 09:25:04 -06:00
UpdateElasticIndex.pm Bug 40163: Fix several http addresses in the code docs 2025-09-23 16:21:29 -06:00