Checkins for age protected items on Bib Records with many holds can take a long time
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Evergreen |
Confirmed
|
Medium
|
Unassigned |
Bug Description
Here are a couple of use cases:
Use case 1:
My item attached to a new bestseller is under age-based hold protection. The bib record has 75 holds, but none for pickup at my library. When I check in the item it takes six seconds for the checkin to process. The item goes to Reshelving status.
Use case 2:
My rental item attached to a new bestseller has the holdable flag set to FALSE. The bib record has 75 holds. When I check the item in, it takes seven seconds for the checkin to process. The item goes to Reshelving status.
The library that reported this issue has come up with a name for these items as this occurs frequently: "slow barcodes".
System logs show that holds are being checked in succession to see if the copy can fill each one:
2018-11-14 11:48:37 brick0 open-ils.circ: [INFO:196158:
2018-11-14 11:48:37 brick0 open-ils.circ: [INFO:196158:
2018-11-14 11:48:37 brick0 open-ils.circ: [INFO:196158:
2018-11-14 11:48:37 brick0 open-ils.circ: [INFO:196158:
2018-11-14 11:48:37 brick0 open-ils.circ: [INFO:196158:
2018-11-14 11:48:37 brick0 open-ils.circ: [INFO:196158:
2018-11-14 11:48:37 brick0 open-ils.circ: [INFO:196158:
Many seconds pass as the holds are checked. This makes sense in general, but isn't efficient for age hold protected items that can only fill a subset of the total holds on the record, and less so for items where the holdable flag is set to FALSE.
While it's true that type F and R holds will still apply to these items, it doesn't really make sense to check every hold on the off chance that there may be a F or R type hold that would apply. Prefiltering the holds to be checked and/or handling special case hold types (like F and R) and special case items (like age protected and not holdable) differently would greatly improve efficiency at checkin.
I'm also adding a link to a related bug that points out that the limit on the number of holds checked is 100, so holds applicable to the item can be missed:
Changed in evergreen: | |
status: | New → Confirmed |
One simple way to pre-filter would be to hook into the best hold selection sort.
To keep non R and F holds from being evaluated for non holdable copies, something like this could be done.
And the following to the best hold selection sort query - http:// git.evergreen- ils.org/ ?p=Evergreen. git;a=blob; f=Open- ILS/src/ perlmods/ lib/OpenILS/ Application/ Storage/ Publisher/ action. pm#l581
AND (h.hold_type IN ('R','F') or exists (select 1 from asset.copy acp where acp.id= hm.target_ copy and acp.holdable) )
That would result in only Recall and Force holds being included when a copy isn't holdable because of the asset.copy holdable field.
The performance impact of that addition seems to be minor when I try it out, but I think that would take care of the above issue with a rental item that isn't holdable.
This wouldn't help if an item isn't holdable because of shelving location, but that could also be added. I wouldn't think that status would apply in this instance, since this isn't for targeting.
An age hold protection filter can probably also be added this way, but that has more variables to pull in.
I don't know if this is really a good solution though, since it moves permit hold logic into the nearest hold section. It may make things less understandable in the future.
Josh