From: Jason Stephenson Date: Tue, 10 May 2022 15:07:25 +0000 (-0400) Subject: LP1972738: Add index on hopeless date X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=71df266db6b8ba782ef2d4b00032974c44713ce8;p=evergreen%2Fpines.git LP1972738: Add index on hopeless date Add an index on action.hold_request hopeless_date column to speed up hopeless holds processing. Signed-off-by: Jason Stephenson Signed-off-by: Galen Charlton --- diff --git a/Open-ILS/src/sql/Pg/090.schema.action.sql b/Open-ILS/src/sql/Pg/090.schema.action.sql index 711269e245..90518414d2 100644 --- a/Open-ILS/src/sql/Pg/090.schema.action.sql +++ b/Open-ILS/src/sql/Pg/090.schema.action.sql @@ -526,7 +526,7 @@ CREATE INDEX hold_request_copy_capture_time_idx ON action.hold_request (current_ CREATE INDEX hold_request_open_captured_shelf_lib_idx ON action.hold_request (current_shelf_lib) WHERE capture_time IS NOT NULL AND fulfillment_time IS NULL AND (pickup_lib <> current_shelf_lib); CREATE INDEX hold_fulfillment_time_idx ON action.hold_request (fulfillment_time) WHERE fulfillment_time IS NOT NULL; CREATE INDEX hold_request_time_idx ON action.hold_request (request_time); - +CREATE INDEX hold_request_hopeless_date_idx ON action.hold_request (hopeless_date); CREATE TABLE action.hold_request_note ( diff --git a/Open-ILS/src/sql/Pg/upgrade/XXXX.schema.add-hopeless-date-index.sql b/Open-ILS/src/sql/Pg/upgrade/XXXX.schema.add-hopeless-date-index.sql new file mode 100644 index 0000000000..d07cd400b4 --- /dev/null +++ b/Open-ILS/src/sql/Pg/upgrade/XXXX.schema.add-hopeless-date-index.sql @@ -0,0 +1,7 @@ +BEGIN; + +--SELECT evergreen.upgrade_deps_block_check('XXXX', :eg_version); + +CREATE INDEX hold_request_hopeless_date_idx ON action.hold_request (hopeless_date); + +COMMIT;