JBAS-1997 Prevent sequential scans in hold queue pos func
authorBill Erickson <berickxx@gmail.com>
Thu, 15 Mar 2018 15:16:25 +0000 (11:16 -0400)
committerBill Erickson <berickxx@gmail.com>
Thu, 21 Mar 2019 19:46:23 +0000 (15:46 -0400)
commit213ed9b3c964e9d1d5e8bef0b0ad87356c9e962c
tree001236662e699bd924f84b9ac689daf6f5047bba
parent3f105dc6e38331d76c775724367ed4705c5eb283
JBAS-1997 Prevent sequential scans in hold queue pos func

Brute-force the PG planner to make it use index scans instead of
sequential scans in the hold queue position stored proc.  This resolves
a problem where the planner starts using seq scans over time as the
stats morph in the presence of lots of active, large-queue holds.

Avoidin the seq scan shows consistently better performance.

Signed-off-by: Bill Erickson <berickxx@gmail.com>
KCLS/sql/schema/deploy/hold-queue-pos-func.sql