[Bug 43103] New: Batch item modification and patron deletion query IDs as OR query chains
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=43103 Bug ID: 43103 Summary: Batch item modification and patron deletion query IDs as OR query chains Initiative type: --- Sponsorship --- status: Product: Koha Version: Main Hardware: All OS: All Status: NEW Severity: normal Priority: P5 - low Component: Architecture, internals, and plumbing Assignee: koha-bugs@lists.koha-community.org Reporter: kyle@bywatersolutions.com QA Contact: testopia@bugs.koha-community.org Target Milestone: --- As with bug 43101, these OR chains should be replaced with IN based subqueries for improved performance. -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=43103 Kyle M Hall (khall) <kyle@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- See Also| |https://bugs.koha-community | |.org/bugzilla3/show_bug.cgi | |?id=43101 CC| |kyle@bywatersolutions.com -- You are receiving this mail because: You are watching all bug changes. You are the assignee for the bug.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=43103 Kyle M Hall (khall) <kyle@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- See Also| |https://bugs.koha-community | |.org/bugzilla3/show_bug.cgi | |?id=43102 -- You are receiving this mail because: You are watching all bug changes. You are the assignee for the bug.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=43103 Kyle M Hall (khall) <kyle@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Assignee|koha-bugs@lists.koha-commun |kyle@bywatersolutions.com |ity.org | -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=43103 Kyle M Hall (khall) <kyle@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |Needs Signoff -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=43103 --- Comment #1 from Kyle M Hall (khall) <kyle@bywatersolutions.com> --- Created attachment 202111 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=202111&action=edit 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! -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=43103 David Nind <david@davidnind.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Needs Signoff |Signed Off -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=43103 David Nind <david@davidnind.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #202111|0 |1 is obsolete| | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=43103 --- Comment #2 from David Nind <david@davidnind.com> --- Created attachment 202115 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=202115&action=edit 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> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=43103 Lisette Scheer <lisette@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |lisette@bywatersolutions.co | |m QA Contact|testopia@bugs.koha-communit |emily.lamancusa@montgomeryc |y.org |ountymd.gov -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=43103 Emily Lamancusa (emlam) <emily.lamancusa@montgomerycountymd.gov> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #202115|0 |1 is obsolete| | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=43103 --- Comment #3 from Emily Lamancusa (emlam) <emily.lamancusa@montgomerycountymd.gov> --- Created attachment 202748 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=202748&action=edit 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> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=43103 Emily Lamancusa (emlam) <emily.lamancusa@montgomerycountymd.gov> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Signed Off |Passed QA -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=43103 Pedro Amorim (ammopt) <pedro.amorim@openfifth.co.uk> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Passed QA |Pushed to main Version(s)| |26.11.00 released in| | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=43103 --- Comment #4 from Pedro Amorim (ammopt) <pedro.amorim@openfifth.co.uk> --- Thanks everyone! Pushed to main for 26.11! -- You are receiving this mail because: You are watching all bug changes.
participants (1)
-
bugzilla-daemon@bugs.koha-community.org