LP1972738: Add index on hopeless date
authorJason Stephenson <jason@sigio.com>
Tue, 10 May 2022 15:07:25 +0000 (11:07 -0400)
committerGalen Charlton <gmc@equinoxOLI.org>
Mon, 27 Mar 2023 19:55:47 +0000 (15:55 -0400)
Add an index on action.hold_request hopeless_date column to speed up
hopeless holds processing.

Signed-off-by: Jason Stephenson <jason@sigio.com>
Signed-off-by: Galen Charlton <gmc@equinoxOLI.org>
Open-ILS/src/sql/Pg/090.schema.action.sql
Open-ILS/src/sql/Pg/upgrade/XXXX.schema.add-hopeless-date-index.sql [new file with mode: 0644]

index 711269e..9051841 100644 (file)
@@ -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 (file)
index 0000000..d07cd40
--- /dev/null
@@ -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;