[open-ils-commits] r18842 - in trunk/Open-ILS/src/sql/Pg: . upgrade (dbs)
svn at svn.open-ils.org
svn at svn.open-ils.org
Tue Nov 23 22:31:17 EST 2010
Author: dbs
Date: 2010-11-23 22:31:14 -0500 (Tue, 23 Nov 2010)
New Revision: 18842
Added:
trunk/Open-ILS/src/sql/Pg/upgrade/0466.schema.asset-copy-add-create-date-index.sql
Modified:
trunk/Open-ILS/src/sql/Pg/002.schema.config.sql
trunk/Open-ILS/src/sql/Pg/040.schema.asset.sql
Log:
Add an index on asset.copy(create_date) for item-age browse
Running an item-age browse against a database with a reasonable
number of entries in asset.copy is dog-slow without an index
like this.
Modified: trunk/Open-ILS/src/sql/Pg/002.schema.config.sql
===================================================================
--- trunk/Open-ILS/src/sql/Pg/002.schema.config.sql 2010-11-23 21:52:01 UTC (rev 18841)
+++ trunk/Open-ILS/src/sql/Pg/002.schema.config.sql 2010-11-24 03:31:14 UTC (rev 18842)
@@ -70,7 +70,7 @@
install_date TIMESTAMP WITH TIME ZONE NOT NULL DEFAULT NOW()
);
-INSERT INTO config.upgrade_log (version) VALUES ('0465'); -- dbs
+INSERT INTO config.upgrade_log (version) VALUES ('0466'); -- dbs
CREATE TABLE config.bib_source (
id SERIAL PRIMARY KEY,
Modified: trunk/Open-ILS/src/sql/Pg/040.schema.asset.sql
===================================================================
--- trunk/Open-ILS/src/sql/Pg/040.schema.asset.sql 2010-11-23 21:52:01 UTC (rev 18841)
+++ trunk/Open-ILS/src/sql/Pg/040.schema.asset.sql 2010-11-24 03:31:14 UTC (rev 18842)
@@ -88,6 +88,7 @@
CREATE INDEX cp_avail_cn_idx ON asset.copy (call_number);
CREATE INDEX cp_creator_idx ON asset.copy ( creator );
CREATE INDEX cp_editor_idx ON asset.copy ( editor );
+CREATE INDEX cp_create_date ON asset.copy (create_date);
CREATE RULE protect_copy_delete AS ON DELETE TO asset.copy DO INSTEAD UPDATE asset.copy SET deleted = TRUE WHERE OLD.id = asset.copy.id;
CREATE TABLE asset.opac_visible_copies (
Added: trunk/Open-ILS/src/sql/Pg/upgrade/0466.schema.asset-copy-add-create-date-index.sql
===================================================================
--- trunk/Open-ILS/src/sql/Pg/upgrade/0466.schema.asset-copy-add-create-date-index.sql (rev 0)
+++ trunk/Open-ILS/src/sql/Pg/upgrade/0466.schema.asset-copy-add-create-date-index.sql 2010-11-24 03:31:14 UTC (rev 18842)
@@ -0,0 +1,8 @@
+
+BEGIN;
+
+INSERT INTO config.upgrade_log (version) VALUES ('0466'); -- dbs
+
+CREATE INDEX cp_create_date ON asset.copy (create_date);
+
+COMMIT;
More information about the open-ils-commits
mailing list