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:54:09 +0000 (14:54 -0500)
commitff3fd28f623f35ffd54af55d9c87604ace76cfb4
treea3863a49cf4bd430777230aea814cf56ebc0e133
parent8f6645b5eec6fab135fe5904cc80ff0e79b2d3f5
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