LP#1971745 - speed up open-ils.storage.action.live_holds.wide_hash user/stompro/lp1971745_speed_up_holds_query
authorJosh Stompro <stomproj@larl.org>
Tue, 22 Nov 2022 18:09:46 +0000 (12:09 -0600)
committerJosh Stompro <stompro@stompro.org>
Tue, 22 Nov 2022 18:44:03 +0000 (12:44 -0600)
commit6c55377c49c011009082cf3f583daaa3142bc31e
tree9d3e00c285cfa1baf67e182b9133104f133bf717
parent1762a17d803a77a88fa3d2d60e80f68036ccca1c
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>
Open-ILS/src/perlmods/lib/OpenILS/Application/Storage/Publisher/action.pm