Use top level join instead of subquery in hold queue position query
authormiker <miker@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Tue, 19 Apr 2011 19:51:26 +0000 (19:51 +0000)
committermiker <miker@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Tue, 19 Apr 2011 19:51:26 +0000 (19:51 +0000)
commitcf973b14854f0640a50d30f9dbd2afd8299d6d65
treef9d1f5b4d8e577351fd050fc0663c87ba48f1ad7
parent0ea7d277d7e0e824519a44c247033141ff887552
Use top level join instead of subquery in hold queue position query

This is more readily optimized by the Postgres planer.

Note also, for very large data sets (lots of holds, on the order of 100k+ active), the following is also advised:

 ALTER TABLE action.hold_copy_map alter column target_copy SET statistics 500, alter column hold set statistics 500;
 ANALYZE action.hold_copy_map;

This gives the planner better data about the hold-copy-map n-distinct.

git-svn-id: svn://svn.open-ils.org/ILS/branches/rel_2_0@20219 dcc99617-32d9-48b4-a31d-7c20da2025e4
Open-ILS/src/perlmods/OpenILS/Application/Circ/Holds.pm