[open-ils-commits] r14400 - in trunk/Open-ILS/src/sql/Pg: . upgrade (dbs)
svn at svn.open-ils.org
svn at svn.open-ils.org
Tue Oct 13 11:10:01 EDT 2009
Author: dbs
Date: 2009-10-13 11:09:58 -0400 (Tue, 13 Oct 2009)
New Revision: 14400
Modified:
trunk/Open-ILS/src/sql/Pg/030.schema.metabib.sql
trunk/Open-ILS/src/sql/Pg/upgrade/0030.data.flat-subject-entries.sql
Log:
Enhance upgrade for complete subject indexing: drop the unnecessary final ORDER BY clause and create an index on the source record.
Cuts upgrade time to about one one-hundredth of what it was before.
Modified: trunk/Open-ILS/src/sql/Pg/030.schema.metabib.sql
===================================================================
--- trunk/Open-ILS/src/sql/Pg/030.schema.metabib.sql 2009-10-13 14:30:06 UTC (rev 14399)
+++ trunk/Open-ILS/src/sql/Pg/030.schema.metabib.sql 2009-10-13 15:09:58 UTC (rev 14400)
@@ -69,6 +69,7 @@
FOR EACH ROW EXECUTE PROCEDURE oils_tsearch2('subject');
CREATE INDEX metabib_subject_field_entry_index_vector_idx ON metabib.subject_field_entry USING GIST (index_vector);
+CREATE INDEX metabib_subject_field_entry_source_idx ON metabib.subject_field_entry (source);
CREATE TABLE metabib.keyword_field_entry (
Modified: trunk/Open-ILS/src/sql/Pg/upgrade/0030.data.flat-subject-entries.sql
===================================================================
--- trunk/Open-ILS/src/sql/Pg/upgrade/0030.data.flat-subject-entries.sql 2009-10-13 14:30:06 UTC (rev 14399)
+++ trunk/Open-ILS/src/sql/Pg/upgrade/0030.data.flat-subject-entries.sql 2009-10-13 15:09:58 UTC (rev 14400)
@@ -8,6 +8,8 @@
INSERT INTO config.metabib_field (field_class, name, format, xpath ) VALUES
( 'subject', 'complete', 'mods32', $$//mods32:mods/mods32:subject//text()$$ );
+CREATE INDEX metabib_subject_field_entry_source_idx ON metabib.subject_field_entry (source);
+
INSERT INTO metabib.subject_field_entry (source, field, value)
SELECT source, (
SELECT id
@@ -26,7 +28,6 @@
SELECT source
FROM metabib.subject_field_entry
GROUP BY source
- ) AS groupee
- ORDER BY source;
+ ) AS groupee;
COMMIT;
More information about the open-ils-commits
mailing list