]> git.koha-community.org Git - koha.git/commit
Bug 31222: Reduce query size for batchMod
authorNick Clemens <nick@bywatersolutions.com>
Fri, 22 Jul 2022 14:47:36 +0000 (14:47 +0000)
committerArthur Suzuki <arthur.suzuki@biblibre.com>
Wed, 12 Oct 2022 14:44:38 +0000 (16:44 +0200)
commitb6b569b20aef7c293f1f6bdbb7b56276132f9aaf
treef81966491463a746b25fcaf2bc0d95eab872ef72
parentcbe8631c7173fe2bb55cfdd8393edf6ca25a352b
Bug 31222: Reduce query size for batchMod

The object search is currently:
Koha::Items->search({ barcode => \@contentlist }

Which generate code like:
barcode = 1 OR barcode = 2 OR barcode = 3 ....

This can get quite large

We can reduce the query size by using -in:
Koha::Items->search({ barcode => { -in => \@contentlist } }

Which generates code like:
barcode in ( 1, 2, 3 )

To test:
1 - Apply patch
2 - Perform batch modifications
3 - Confirm nothing has changed

Signed-off-by: Rachael Laritz <rachael.laritz@inlibro.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 7343e404b7b486c52a150613f308e452f4f5da05)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit dd5fcd9de3b6c9201c20e3b279f25649d1e7fac0)
Signed-off-by: Arthur Suzuki <arthur.suzuki@biblibre.com>
tools/batchMod.pl