From 5a86a4d22fdf828fde6a6380b803837a6c28c94d Mon Sep 17 00:00:00 2001 From: Galen Charlton Date: Thu, 3 Jun 2021 11:39:13 -0400 Subject: [PATCH] LP#1904244: schema: add two indexes These two indexes support retrieving transactions that account for a given fund debit. Signed-off-by: Galen Charlton Signed-off-by: Ruth Frasur Signed-off-by: Bill Erickson --- Open-ILS/src/sql/Pg/200.schema.acq.sql | 2 ++ Open-ILS/src/sql/Pg/upgrade/WWWW.schema.add_indexes.sql | 6 ++++++ 2 files changed, 8 insertions(+) create mode 100644 Open-ILS/src/sql/Pg/upgrade/WWWW.schema.add_indexes.sql diff --git a/Open-ILS/src/sql/Pg/200.schema.acq.sql b/Open-ILS/src/sql/Pg/200.schema.acq.sql index 0cfb6089dc..2d8678a9b9 100644 --- a/Open-ILS/src/sql/Pg/200.schema.acq.sql +++ b/Open-ILS/src/sql/Pg/200.schema.acq.sql @@ -916,6 +916,7 @@ CREATE TABLE acq.po_item ( ); CREATE INDEX poi_po_idx ON acq.po_item (purchase_order); +CREATE INDEX poi_fund_debit_idx ON acq.po_item (fund_debit); CREATE TABLE acq.invoice_item ( -- for invoice-only debits: taxes/fees/non-bib items/etc id SERIAL PRIMARY KEY, @@ -939,6 +940,7 @@ CREATE TABLE acq.invoice_item ( -- for invoice-only debits: taxes/fees/non-bib i CREATE INDEX ii_inv_idx on acq.invoice_item (invoice); CREATE INDEX ii_po_idx on acq.invoice_item (purchase_order); CREATE INDEX ii_poi_idx on acq.invoice_item (po_item); +CREATE INDEX ii_fund_debit_idx ON acq.invoice_item (fund_debit); -- Patron requests CREATE TABLE acq.user_request_type ( diff --git a/Open-ILS/src/sql/Pg/upgrade/WWWW.schema.add_indexes.sql b/Open-ILS/src/sql/Pg/upgrade/WWWW.schema.add_indexes.sql new file mode 100644 index 0000000000..30296c0e6d --- /dev/null +++ b/Open-ILS/src/sql/Pg/upgrade/WWWW.schema.add_indexes.sql @@ -0,0 +1,6 @@ +BEGIN; + +CREATE INDEX poi_fund_debit_idx ON acq.po_item (fund_debit); +CREATE INDEX ii_fund_debit_idx ON acq.invoice_item (fund_debit); + +COMMIT; -- 2.11.0