hold count by record includes useless where clause

Bug #1201962 reported by Mike Rylander
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Evergreen
Fix Released
Medium
Unassigned
2.3
Invalid
Medium
Unassigned
2.4
Fix Released
Medium
Unassigned

Bug Description

When rendering results in the tpac we request hold counts for each record. Most of the time (that is, whenever org unit hiding is /not/ in use) we filter, essentially, on "where pickup_lib is in the org tree". This is both useless and slow, so this commit will recognize that and optimize the test away.

The end result is a (sometimes) multi-second query one a mid-sized data set becomes a millisecond query.

http://git.evergreen-ils.org/?p=working/Evergreen.git;a=shortlog;h=refs/heads/user/miker/faster-hold-count-per-record

Revision history for this message
Lebbeous Fogle-Weekley (lebbeous) wrote :

I have tested this and signed off on a version with a trivial typo fix. It works as advertised for master and rel_2_4.

I don't believe this actually applies to rel_2_3. The code that has the filter you're optimizing away didn't come in until rel_2_4, with TPAC org-unit hiding.

Merged to master and rel_2_4.

Changed in evergreen:
status: New → Fix Committed
Ben Shum (bshum)
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.