Use of the new fund_debit.invoice_entry column includes a query joining
fund_debits to lineitem_details. On sufficiently large data sets
(tested on 2M rows), the query can take > 1 second without the index.
Down to < 1ms with the index.
Signed-off-by: Bill Erickson <berickxx@gmail.com>
Signed-off-by: Jennifer Pringle <jennifer.pringle@bc.libraries.coop>
Signed-off-by: Kathy Lussier <klussier@masslnc.org>
);
CREATE INDEX li_detail_li_idx ON acq.lineitem_detail (lineitem);
+CREATE INDEX lineitem_detail_fund_debit_idx ON acq.lineitem_detail (fund_debit);
CREATE TABLE acq.lineitem_attr_definition (
id BIGSERIAL PRIMARY KEY,
ON DELETE SET NULL;
CREATE INDEX fund_debit_invoice_entry_idx ON acq.fund_debit (invoice_entry);
+CREATE INDEX lineitem_detail_fund_debit_idx ON acq.lineitem_detail (fund_debit);
COMMIT;