Bug 33942

Summary: Improve performance of local holds priority by temporarily caching patrons and items
Product: Koha Reporter: Kyle M Hall (khall) <kyle>
Component: Hold requestsAssignee: Kyle M Hall (khall) <kyle>
Status: CLOSED WONTFIX QA Contact: Testopia <testopia>
Severity: enhancement    
Priority: P5 - low CC: gmcharlt, nick, samalau
Version: Main   
Hardware: All   
OS: All   
GIT URL: Initiative type: ---
Sponsorship status: --- Comma delimited list of Sponsors:
Crowdfunding goal: 0 Crowdfunding committed: 0
Crowdfunding contact: Patch complexity: ---
Documentation contact: Documentation submission:
Text to go in the release notes:
Version(s) released in:
Circulation function:
Attachments: Bug 33942: Improve performance of local holds priority by temporarily caching patrons and items

Description Kyle M Hall (khall) 2023-06-07 16:31:28 UTC
For records with many item level holds by many patrons ( with multiple item level holds per record ), we fetch the item and patron from the database fresh on each loop iteration. If we store these in a hash it should speed this up in the case of large numbers of these holds.
Comment 1 Kyle M Hall (khall) 2023-06-07 16:46:42 UTC
Created attachment 152122 [details] [review]
Bug 33942: Improve performance of local holds priority by temporarily caching patrons and items

Test Plan:
1) Apply this patch
2) prove -r t/db_dependent/Hold*
3) Note all tests continue to pass
Comment 2 Sam Lau 2023-06-08 15:21:41 UTC
Using index info to reconstruct a base tree...
M	C4/Reserves.pm
Falling back to patching base and 3-way merge...
Auto-merging C4/Reserves.pm
CONFLICT (content): Merge conflict in C4/Reserves.pm
error: Failed to merge in the changes.
Patch failed at 0001 Bug 33942: Improve performance of local holds priority by temporarily caching patrons and items
Comment 3 Nick Clemens (kidclamp) 2023-06-14 10:41:27 UTC
This seems to only offer benefit in a small number of edge cases, we won't pursue this one