From: Galen Charlton Date: Thu, 3 Jun 2021 15:39:13 +0000 (-0400) Subject: LP#1904244: schema: add two indexes X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=5a86a4d22fdf828fde6a6380b803837a6c28c94d;p=evergreen%2Ftadl.git 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 --- 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;