LP#800706: add index to serial.record_entry.record
authorGalen Charlton <gmc@esilibrary.com>
Tue, 12 May 2015 19:27:07 +0000 (15:27 -0400)
committerJason Stephenson <jstephenson@mvlc.org>
Wed, 13 May 2015 17:54:37 +0000 (13:54 -0400)
This patch adds index on the record column of serial.record_entry,
which can improve performance when displaying record details pages
in databases that have a large number MFHDs.

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
Signed-off-by: Jason Stephenson <jstephenson@mvlc.org>
Open-ILS/src/sql/Pg/210.schema.serials.sql
Open-ILS/src/sql/Pg/upgrade/XXXX.schema.index-record-in-sre.sql [new file with mode: 0644]

index 620d57e..2e5af44 100644 (file)
@@ -20,6 +20,7 @@ CREATE TABLE serial.record_entry (
        marc            TEXT,
        last_xact_id    TEXT            NOT NULL
 );
+CREATE INDEX serial_record_entry_record_idx ON serial.record_entry ( record );
 CREATE INDEX serial_record_entry_creator_idx ON serial.record_entry ( creator );
 CREATE INDEX serial_record_entry_editor_idx ON serial.record_entry ( editor );
 CREATE INDEX serial_record_entry_owning_lib_idx ON serial.record_entry ( owning_lib, deleted );
diff --git a/Open-ILS/src/sql/Pg/upgrade/XXXX.schema.index-record-in-sre.sql b/Open-ILS/src/sql/Pg/upgrade/XXXX.schema.index-record-in-sre.sql
new file mode 100644 (file)
index 0000000..aea7e08
--- /dev/null
@@ -0,0 +1,9 @@
+-- index serial.record_entry.record
+
+BEGIN;
+
+-- SELECT evergreen.upgrade_deps_block_check('XXXX', :eg_version);
+
+CREATE INDEX serial_record_entry_record_idx ON serial.record_entry ( record );
+
+COMMIT;