Bug 14320 - Improve the speed of the checkouts table loading items with many holds and items using AllowRenewalIfOtherItemsAvailable
Summary: Improve the speed of the checkouts table loading items with many holds and it...
Status: CLOSED INVALID
Alias: None
Product: Koha
Classification: Unclassified
Component: Circulation (show other bugs)
Version: 3.18
Hardware: All All
: P5 - low enhancement
Assignee: Bugs List
QA Contact: Testopia
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-06-03 11:18 UTC by Kyle M Hall (khall)
Modified: 2016-06-21 21:36 UTC (History)
2 users (show)

See Also:
Change sponsored?: ---
Patch complexity: ---
Documentation contact:
Documentation submission:
Text to go in the release notes:
Version(s) released in:
Circulation function:


Attachments
Bug 14320 - WIP (2.39 KB, patch)
2015-06-03 14:01 UTC, Kyle M Hall (khall)
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Kyle M Hall (khall) 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 (khall) 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 (khall) 2015-06-03 14:01:33 UTC
Created attachment 39808 [details] [review]
Bug 14320 - WIP
Comment 3 Kyle M Hall (khall) 2015-06-03 14:02:19 UTC
My best effort looks like it offers little to no improvement. Closing out the bug.