From 4ca421fcb2d489502a1a9f61b4f9a4871a86f0f9 Mon Sep 17 00:00:00 2001 From: Galen Charlton Date: Wed, 22 Apr 2015 13:43:19 +0000 Subject: [PATCH] LP#1447168: add an index on authority.simple_heading.record This index is needed so that full table scans on ash aren't needed during authority record reingest. Signed-off-by: Galen Charlton Signed-off-by: Dan Wells --- Open-ILS/src/sql/Pg/011.schema.authority.sql | 1 + .../src/sql/Pg/upgrade/XXXX.schema.index_ash_record.sql | 9 +++++++++ 2 files changed, 10 insertions(+) create mode 100644 Open-ILS/src/sql/Pg/upgrade/XXXX.schema.index_ash_record.sql diff --git a/Open-ILS/src/sql/Pg/011.schema.authority.sql b/Open-ILS/src/sql/Pg/011.schema.authority.sql index bb4aca04d9..0cb742f5d8 100644 --- a/Open-ILS/src/sql/Pg/011.schema.authority.sql +++ b/Open-ILS/src/sql/Pg/011.schema.authority.sql @@ -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 index 0000000000..cd0aa25449 --- /dev/null +++ b/Open-ILS/src/sql/Pg/upgrade/XXXX.schema.index_ash_record.sql @@ -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; -- 2.43.2