Patch from Galen Charlton: This resolves a performance issue found by EG Indiana...
authorerickson <erickson@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Wed, 12 May 2010 19:20:05 +0000 (19:20 +0000)
committererickson <erickson@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Wed, 12 May 2010 19:20:05 +0000 (19:20 +0000)
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
Open-ILS/src/sql/Pg/040.schema.asset.sql
Open-ILS/src/sql/Pg/upgrade/0258.schema.scecm_owning_copy_idx.sql [new file with mode: 0644]

index 18ca5ba..8abc2a6 100644 (file)
@@ -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,
index c35d188..001e8e3 100644 (file)
@@ -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 (file)
index 0000000..edd64c3
--- /dev/null
@@ -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;