Bug 14320

Summary: Improve the speed of the checkouts table loading items with many holds and items using AllowRenewalIfOtherItemsAvailable
Product: Koha Reporter: Kyle M Hall <kyle>
Component: CirculationAssignee: Bugs List <koha-bugs>
Status: CLOSED INVALID QA Contact: Testopia <testopia>
Severity: enhancement    
Priority: P5 - low CC: gmcharlt, kyle.m.hall
Version: 3.18   
Hardware: All   
OS: All   
Change sponsored?: --- Patch complexity: ---
Documentation contact: Documentation submission:
Text to go in the release notes:
Version(s) released in:
Attachments: Bug 14320 - WIP

Description Kyle M Hall 2015-06-03 11:18:05 UTC
The feature AllowRenewalIfOtherItemsAvailable can take a tremendous amount of processing for records with large numbers of holds and/or items. For example, for a record with 50 items and 100 holds we must call a series of subroutines 5000 times!

The loop this processing takes place in has an outer loop of borrowers and an inner loop of items. However, two of the three subroutines only need an itemnumber. So, if we move the items loop to be the outer loop, we can 'cache' these subroutine calls and vastly improve the speed of the subroutine.
Comment 1 Kyle M Hall 2015-06-03 11:36:00 UTC
I was looking at v3.18. Looks like these speed improvements won't apply to master due to changes in IsAvailableForItemLevelRequest. I'll see if there is any way to improve this in master.
Comment 2 Kyle M Hall 2015-06-03 14:01:33 UTC
Created attachment 39808 [details] [review]
Bug 14320 - WIP
Comment 3 Kyle M Hall 2015-06-03 14:02:19 UTC
My best effort looks like it offers little to no improvement. Closing out the bug.