LP#1447168: add an index on authority.simple_heading.record
authorGalen Charlton <gmc@esilibrary.com>
Wed, 22 Apr 2015 13:43:19 +0000 (13:43 +0000)
committerDan Wells <dbw2@calvin.edu>
Wed, 10 Jun 2015 18:26:20 +0000 (14:26 -0400)
This index is needed so that full table scans on ash aren't
needed during authority record reingest.

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
Signed-off-by: Dan Wells <dbw2@calvin.edu>
Open-ILS/src/sql/Pg/011.schema.authority.sql
Open-ILS/src/sql/Pg/upgrade/XXXX.schema.index_ash_record.sql [new file with mode: 0644]

index bb4aca0..0cb742f 100644 (file)
@@ -316,6 +316,7 @@ CREATE TRIGGER authority_simple_heading_fti_trigger
 CREATE INDEX authority_simple_heading_index_vector_idx ON authority.simple_heading USING GIST (index_vector);
 CREATE INDEX authority_simple_heading_value_idx ON authority.simple_heading (value);
 CREATE INDEX authority_simple_heading_sort_value_idx ON authority.simple_heading (sort_value);
+CREATE INDEX authority_simple_heading_record_idx ON authority.simple_heading (record);
 
 CREATE OR REPLACE FUNCTION authority.simple_heading_set( marcxml TEXT ) RETURNS SETOF authority.simple_heading AS $func$
 DECLARE
diff --git a/Open-ILS/src/sql/Pg/upgrade/XXXX.schema.index_ash_record.sql b/Open-ILS/src/sql/Pg/upgrade/XXXX.schema.index_ash_record.sql
new file mode 100644 (file)
index 0000000..cd0aa25
--- /dev/null
@@ -0,0 +1,9 @@
+-- index authority.simple_heading.record so that reingesting
+-- authority records does not require a sequential scan of ash
+BEGIN;
+
+SELECT evergreen.upgrade_deps_block_check('XXXX', :eg_version);
+
+CREATE INDEX authority_simple_heading_record_idx ON authority.simple_heading (record);
+
+COMMIT;