LP#1971745 - speed up open-ils.storage.action.live_holds.wide_hash
authorJosh Stompro <stomproj@larl.org>
Tue, 22 Nov 2022 18:09:46 +0000 (12:09 -0600)
committerJason Stephenson <jstephenson@cwmars.org>
Mon, 28 Nov 2022 19:53:00 +0000 (14:53 -0500)
commite7acf4a00c3948fac5f270926c3838459d57434e
tree233032ff09166368bbc1a36078f2fdd607a142c3
parent1ac2ab4e59cc83292746df731bad708e4a83d662
LP#1971745 - speed up open-ils.storage.action.live_holds.wide_hash

Postgresql 10 and EG 3.9.0

The query to grab holds on the hold shelf was taking 35-50 seconds on
a test system to return 466 records.  Explain analyze showed that the
left join on asset.call_number was causing a sequential scan and reading
all asset.call_number rows.

Letting PG know that the two conditions of the join are mutually exclusive
seems to let PG know that an index scan is faster.

Signed-off-by: Josh Stompro <stomproj@larl.org>
Signed-off-by: Jason Stephenson <jstephenson@cwmars.org>
Open-ILS/src/perlmods/lib/OpenILS/Application/Storage/Publisher/action.pm