From 9432276ce1c615d629feb6e13c8e9476a423f834 Mon Sep 17 00:00:00 2001 From: erickson Date: Wed, 12 May 2010 19:20:05 +0000 Subject: [PATCH] Patch from Galen Charlton: This resolves a performance issue found by EG Indiana on large ascecm tables. git-svn-id: svn://svn.open-ils.org/ILS/trunk@16422 dcc99617-32d9-48b4-a31d-7c20da2025e4 --- Open-ILS/src/sql/Pg/002.schema.config.sql | 2 +- Open-ILS/src/sql/Pg/040.schema.asset.sql | 1 + .../src/sql/Pg/upgrade/0258.schema.scecm_owning_copy_idx.sql | 9 +++++++++ 3 files changed, 11 insertions(+), 1 deletion(-) create mode 100644 Open-ILS/src/sql/Pg/upgrade/0258.schema.scecm_owning_copy_idx.sql diff --git a/Open-ILS/src/sql/Pg/002.schema.config.sql b/Open-ILS/src/sql/Pg/002.schema.config.sql index 18ca5ba31..8abc2a612 100644 --- a/Open-ILS/src/sql/Pg/002.schema.config.sql +++ b/Open-ILS/src/sql/Pg/002.schema.config.sql @@ -65,7 +65,7 @@ CREATE TABLE config.upgrade_log ( install_date TIMESTAMP WITH TIME ZONE NOT NULL DEFAULT NOW() ); -INSERT INTO config.upgrade_log (version) VALUES ('0257'); -- Scott McKellar +INSERT INTO config.upgrade_log (version) VALUES ('0258'); -- Galen Charlton CREATE TABLE config.bib_source ( id SERIAL PRIMARY KEY, diff --git a/Open-ILS/src/sql/Pg/040.schema.asset.sql b/Open-ILS/src/sql/Pg/040.schema.asset.sql index c35d18883..001e8e315 100644 --- a/Open-ILS/src/sql/Pg/040.schema.asset.sql +++ b/Open-ILS/src/sql/Pg/040.schema.asset.sql @@ -157,6 +157,7 @@ CREATE TABLE asset.stat_cat_entry_copy_map ( owning_copy BIGINT NOT NULL, CONSTRAINT sce_once_per_copy UNIQUE (owning_copy,stat_cat) ); +CREATE INDEX scecm_owning_copy_idx ON asset.stat_cat_entry_copy_map(owning_copy); CREATE TABLE asset.copy_note ( id BIGSERIAL PRIMARY KEY, diff --git a/Open-ILS/src/sql/Pg/upgrade/0258.schema.scecm_owning_copy_idx.sql b/Open-ILS/src/sql/Pg/upgrade/0258.schema.scecm_owning_copy_idx.sql new file mode 100644 index 000000000..edd64c312 --- /dev/null +++ b/Open-ILS/src/sql/Pg/upgrade/0258.schema.scecm_owning_copy_idx.sql @@ -0,0 +1,9 @@ +BEGIN; + +INSERT INTO config.upgrade_log (version) VALUES ('0258'); -- Galen Charlton + +-- resolves performance issue noted by EG Indiana + +CREATE INDEX scecm_owning_copy_idx ON asset.stat_cat_entry_copy_map(owning_copy); + +COMMIT; -- 2.11.0