Hopeless holds interface could benefit from an index

Bug #1972738 reported by Galen Charlton
10
This bug affects 2 people
Affects Status Importance Assigned to Milestone
Evergreen
Fix Released
Medium
Unassigned
3.9
Fix Released
Medium
Unassigned

Bug Description

The hopeless holds interface runs the "wide holds" query limited to holds whose "hopeless" date is in a user-specified range.

The query to fetch hopeless holds currently can be slow on large databases as there is currently no index on action.hold_request.hopeless_date. Since, relatively speaking, few holds become hopeless, such an index would be rather selective.

Empirical testing suggests that adding the index can decrease the query time from 3-5 seconds to less than a second, thereby making the interface more responsive. Furthermore, there is reason to believe that a fetch of all hopeless holds in a large consortium could occasionally use query plans that are so bad that many gigabytes of PostgreSQL temp files are created.

Galen Charlton (gmc)
tags: added: circ-holds performance
Changed in evergreen:
status: New → Confirmed
importance: Undecided → Medium
Changed in evergreen:
milestone: none → 3.9.1
assignee: nobody → Jason Stephenson (jstephenson)
Revision history for this message
Jason Stephenson (jstephenson) wrote :

I've pushed a branch that adds the index: user/dyrcona/lp1972738-add-index

https://git.evergreen-ils.org/?p=working/Evergreen.git;a=shortlog;h=refs/heads/user/dyrcona/lp1972738-add-index

tags: added: pullrequest
Changed in evergreen:
assignee: Jason Stephenson (jstephenson) → nobody
Changed in evergreen:
assignee: nobody → Evergreen Bug Maintenance (bugmaster)
assignee: Evergreen Bug Maintenance (bugmaster) → nobody
Revision history for this message
Galen Charlton (gmc) wrote :

I'll test and merge. Noting that I intend to also toss in an ANALYZE on ahr in the update script.

Changed in evergreen:
assignee: nobody → Galen Charlton (gmc)
Changed in evergreen:
milestone: 3.9.1 → none
Galen Charlton (gmc)
no longer affects: evergreen/3.8
no longer affects: evergreen/3.7
Revision history for this message
Galen Charlton (gmc) wrote :

Pushed down to rel_3_9, along with the follow-up I mentioned. Thanks, Jason!

Changed in evergreen:
status: Confirmed → Fix Committed
milestone: none → 3.10.2
assignee: Galen Charlton (gmc) → nobody
Changed in evergreen:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.