[Bug 29702] New: all_libraries routine in library groups make a DB call per member of group
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=29702 Bug ID: 29702 Summary: all_libraries routine in library groups make a DB call per member of group Change sponsored?: --- Product: Koha Version: master Hardware: All OS: All Status: NEW Severity: normal Priority: P5 - low Component: Architecture, internals, and plumbing Assignee: koha-bugs@lists.koha-community.org Reporter: nick@bywatersolutions.com QA Contact: testopia@bugs.koha-community.org The current code gets all group members, then loops through and fetches the library if there is a branchcode, or recursivley calls itself if a group. This slows down performance To recreate: 1 - Add 100 items to a biblio 2 - Define a library group as a hold group 3 - Add all libraries to the group 4 - Set 'Default checkout, hold and return policy'->'Hold pickup library match' = 'Any library' 5 - place a hold on the record and note load time after patron is selected 6 - Set 'Default checkout, hold and return policy'->'Hold pickup library match' = 'Patrons hold group' 7 - place a hold, note longer load time after patron selection -- 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=29702 Nick Clemens <nick@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Patch complexity|--- |Trivial patch Status|NEW |Needs Signoff -- 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=29702 --- Comment #1 from Nick Clemens <nick@bywatersolutions.com> --- Created attachment 128572 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=128572&action=edit Bug 29702: fetch group libraries in a single call The current code gets all group members, then loops through and fetches the library if there is a branchcode, or recursively calls itself if a group. This slows down performance. We can utilize the 'libraries' method to get all child libraries at once, then make a check for child groups separately To recreate: 1 - Add 100 items to a biblio 2 - Define a library group as a hold group 3 - Add all libraries to the group 4 - Set 'Default checkout, hold and return policy'->'Hold pickup library match' = 'Any library' 5 - place a hold on the record and note load time after patron is selected 6 - Set 'Default checkout, hold and return policy'->'Hold pickup library match' = 'Patrons hold group' 7 - place a hold, note longer load time after patron selection 8 - Apply patch 9 - note improvement 10 - prove -v t/db_dependent/Koha/Libraries.t -- 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=29702 Nick Clemens <nick@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Assignee|koha-bugs@lists.koha-commun |nick@bywatersolutions.com |ity.org | -- 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=29702 Andrew Fuerste-Henry <andrew@bywatersolutions.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=29702 Andrew Fuerste-Henry <andrew@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #128572|0 |1 is obsolete| | --- Comment #2 from Andrew Fuerste-Henry <andrew@bywatersolutions.com> --- Created attachment 128843 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=128843&action=edit Bug 29702: fetch group libraries in a single call The current code gets all group members, then loops through and fetches the library if there is a branchcode, or recursively calls itself if a group. This slows down performance. We can utilize the 'libraries' method to get all child libraries at once, then make a check for child groups separately To recreate: 1 - Add 100 items to a biblio 2 - Define a library group as a hold group 3 - Add all libraries to the group 4 - Set 'Default checkout, hold and return policy'->'Hold pickup library match' = 'Any library' 5 - place a hold on the record and note load time after patron is selected 6 - Set 'Default checkout, hold and return policy'->'Hold pickup library match' = 'Patrons hold group' 7 - place a hold, note longer load time after patron selection 8 - Apply patch 9 - note improvement 10 - prove -v t/db_dependent/Koha/Libraries.t Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=29702 Nick Clemens <nick@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |jonathan.druart+koha@gmail. | |com -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=29702 Tomás Cohen Arazi <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- QA Contact|testopia@bugs.koha-communit |tomascohen@gmail.com |y.org | CC| |tomascohen@gmail.com -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=29702 Tomás Cohen Arazi <tomascohen@gmail.com> 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=29702 Tomás Cohen Arazi <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #128843|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=29702 --- Comment #3 from Tomás Cohen Arazi <tomascohen@gmail.com> --- Created attachment 129116 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=129116&action=edit Bug 29702: Fetch group libraries in a single call The current code gets all group members, then loops through and fetches the library if there is a branchcode, or recursively calls itself if a group. This slows down performance. We can utilize the 'libraries' method to get all child libraries at once, then make a check for child groups separately To recreate: 1 - Add 100 items to a biblio 2 - Define a library group as a hold group 3 - Add all libraries to the group 4 - Set 'Default checkout, hold and return policy'->'Hold pickup library match' = 'Any library' 5 - place a hold on the record and note load time after patron is selected 6 - Set 'Default checkout, hold and return policy'->'Hold pickup library match' = 'Patrons hold group' 7 - place a hold, note longer load time after patron selection 8 - Apply patch 9 - note improvement 10 - prove -v t/db_dependent/Koha/Libraries.t Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com> Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=29702 --- Comment #4 from Tomás Cohen Arazi <tomascohen@gmail.com> --- We could try using closure tables to optimize even further. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=29702 Fridolin Somers <fridolin.somers@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Version(s)| |22.05.00 released in| | Status|Passed QA |Pushed to master -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=29702 --- Comment #5 from Fridolin Somers <fridolin.somers@biblibre.com> --- Pushed to master for 22.05, thanks to everybody involved 🦄 -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=29702 Kyle M Hall <kyle@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |kyle@bywatersolutions.com Version(s)|22.05.00 |22.05.00,21.11.02 released in| | Status|Pushed to master |Pushed to stable --- Comment #6 from Kyle M Hall <kyle@bywatersolutions.com> --- Pushed to 21.11.x for 21.11.02 -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=29702 Andrew Fuerste-Henry <andrew@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Pushed to stable |Pushed to oldstable CC| |andrew@bywatersolutions.com Version(s)|22.05.00,21.11.02 |22.05.00,21.11.02,21.05.09 released in| | --- Comment #7 from Andrew Fuerste-Henry <andrew@bywatersolutions.com> --- Pushed to 21.05.x for 21.05.09 -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=29702 Victor Grousset/tuxayo <victor@tuxayo.net> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |victor@tuxayo.net Status|Pushed to oldstable |RESOLVED Resolution|--- |FIXED --- Comment #8 from Victor Grousset/tuxayo <victor@tuxayo.net> --- Not backported to oldoldstable (20.11.x). Feel free to ask if it's needed. -- You are receiving this mail because: You are watching all bug changes.
participants (1)
-
bugzilla-daemon@bugs.koha-community.org