From d52c9c30a4437a8ba8fa184bc9401f1be9f9c947 Mon Sep 17 00:00:00 2001 From: Bill Erickson Date: Thu, 6 Aug 2015 14:36:23 -0400 Subject: [PATCH] cross-porting LP#1479953: Rename indexes to *_idx Signed-off-by: Bill Erickson --- .../src/sql/schema/deploy/schema.index_queued_record.sql | 13 +++++++++++++ .../src/sql/schema/revert/schema.index_queued_record.sql | 14 ++++++++++++++ Open-ILS/src/sql/schema/sqitch.plan | 1 + .../src/sql/schema/verify/schema.index_queued_record.sql | 10 ++++++++++ 4 files changed, 38 insertions(+) create mode 100644 Open-ILS/src/sql/schema/deploy/schema.index_queued_record.sql create mode 100644 Open-ILS/src/sql/schema/revert/schema.index_queued_record.sql create mode 100644 Open-ILS/src/sql/schema/verify/schema.index_queued_record.sql diff --git a/Open-ILS/src/sql/schema/deploy/schema.index_queued_record.sql b/Open-ILS/src/sql/schema/deploy/schema.index_queued_record.sql new file mode 100644 index 0000000000..55ebb2f535 --- /dev/null +++ b/Open-ILS/src/sql/schema/deploy/schema.index_queued_record.sql @@ -0,0 +1,13 @@ +BEGIN; + +/* LP#1479953: Adding indexes to foreign key references to + * vandelay.queued_bib_record will speed up deletions of vqbr records (thereby + * speeding up vandelay.bib_queue deletions). + */ + +CREATE INDEX acq_lineitem_history_queued_record_idx ON acq.acq_lineitem_history (queued_record); +CREATE INDEX li_queued_record_idx ON acq.lineitem (queued_record); +CREATE INDEX bib_match_queued_record_idx ON vandelay.bib_match (queued_record); +CREATE INDEX import_item_record_idx ON vandelay.import_item (record); + +COMMIT; diff --git a/Open-ILS/src/sql/schema/revert/schema.index_queued_record.sql b/Open-ILS/src/sql/schema/revert/schema.index_queued_record.sql new file mode 100644 index 0000000000..9d51f0eaed --- /dev/null +++ b/Open-ILS/src/sql/schema/revert/schema.index_queued_record.sql @@ -0,0 +1,14 @@ +BEGIN; + +/* LP#1479953: Adding indexes to foreign key references to + * vandelay.queued_bib_record will speed up deletions of vqbr records (thereby + * speeding up vandelay.bib_queue deletions). + */ + +DROP INDEX + acq.acq_lineitem_history_queued_record_idx, + acq.li_queued_record_idx, + vandelay.bib_match_queued_record_idx, + vandelay.import_item_record_idx; + +COMMIT; diff --git a/Open-ILS/src/sql/schema/sqitch.plan b/Open-ILS/src/sql/schema/sqitch.plan index 751cfcf790..ed0e02f81e 100644 --- a/Open-ILS/src/sql/schema/sqitch.plan +++ b/Open-ILS/src/sql/schema/sqitch.plan @@ -49,3 +49,4 @@ schema.reporter [data.marc21expand880] 2015-07-16T20:40:14Z Bill Erickson # Creating schema.extend-reporter functions.global [schema.extend-reporter] 2015-07-16T20:40:14Z Bill Erickson # Creating functions.global schema.conditional_negative_balance [functions.global] 2015-08-06T15:28:47Z Bill Erickson # Conditional negative balance schema/data upgrade +schema.index_queued_record [schema.conditional_negative_balance] 2015-08-06T18:25:48Z Bill Erickson # LP#1479953: Rename indexes to *_idx diff --git a/Open-ILS/src/sql/schema/verify/schema.index_queued_record.sql b/Open-ILS/src/sql/schema/verify/schema.index_queued_record.sql new file mode 100644 index 0000000000..4ef1a4e1f0 --- /dev/null +++ b/Open-ILS/src/sql/schema/verify/schema.index_queued_record.sql @@ -0,0 +1,10 @@ +-- Verify evergreen:schema.index_queued_record on pg + +BEGIN; + +SELECT 'acq.acq_lineitem_history_queued_record_idx'::regclass; +SELECT 'acq.li_queued_record_idx'::regclass; +SELECT 'vandelay.bib_match_queued_record_idx'::regclass; +SELECT 'vandelay.import_item_record_idx'::regclass; + +ROLLBACK; -- 2.11.0