cross-porting LP#1479953: Rename indexes to *_idx
authorBill Erickson <berickxx@gmail.com>
Thu, 6 Aug 2015 18:36:23 +0000 (14:36 -0400)
committerBill Erickson <berickxx@gmail.com>
Fri, 28 Aug 2015 21:38:08 +0000 (17:38 -0400)
Signed-off-by: Bill Erickson <berickxx@gmail.com>
Open-ILS/src/sql/schema/deploy/schema.index_queued_record.sql [new file with mode: 0644]
Open-ILS/src/sql/schema/revert/schema.index_queued_record.sql [new file with mode: 0644]
Open-ILS/src/sql/schema/sqitch.plan
Open-ILS/src/sql/schema/verify/schema.index_queued_record.sql [new file with mode: 0644]

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 (file)
index 0000000..55ebb2f
--- /dev/null
@@ -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 (file)
index 0000000..9d51f0e
--- /dev/null
@@ -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;
index 751cfcf..ed0e02f 100644 (file)
@@ -49,3 +49,4 @@ schema.reporter [data.marc21expand880] 2015-07-16T20:40:14Z Bill Erickson <beric
 schema.extend-reporter [schema.reporter] 2015-07-16T20:40:14Z Bill Erickson <berickxx@gmail.com> # Creating schema.extend-reporter
 functions.global [schema.extend-reporter] 2015-07-16T20:40:14Z Bill Erickson <berickxx@gmail.com> # Creating functions.global
 schema.conditional_negative_balance [functions.global] 2015-08-06T15:28:47Z Bill Erickson <berickxx@gmail.com> # Conditional negative balance schema/data upgrade
+schema.index_queued_record [schema.conditional_negative_balance] 2015-08-06T18:25:48Z Bill Erickson <berickxx@gmail.com> # 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 (file)
index 0000000..4ef1a4e
--- /dev/null
@@ -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;