[open-ils-commits] r15963 - in trunk/Open-ILS/src: perlmods/OpenILS/Application/Storage/Driver/Pg sql/Pg sql/Pg/upgrade (miker)
svn at svn.open-ils.org
svn at svn.open-ils.org
Wed Mar 24 16:46:36 EDT 2010
Author: miker
Date: 2010-03-24 16:46:31 -0400 (Wed, 24 Mar 2010)
New Revision: 15963
Added:
trunk/Open-ILS/src/sql/Pg/upgrade/0209.schema.metabib.indexing-facets.sql
Modified:
trunk/Open-ILS/src/perlmods/OpenILS/Application/Storage/Driver/Pg/QueryParser.pm
trunk/Open-ILS/src/sql/Pg/002.schema.config.sql
trunk/Open-ILS/src/sql/Pg/030.schema.metabib.sql
Log:
provide indexes for the new faceting code
Modified: trunk/Open-ILS/src/perlmods/OpenILS/Application/Storage/Driver/Pg/QueryParser.pm
===================================================================
--- trunk/Open-ILS/src/perlmods/OpenILS/Application/Storage/Driver/Pg/QueryParser.pm 2010-03-24 20:18:50 UTC (rev 15962)
+++ trunk/Open-ILS/src/perlmods/OpenILS/Application/Storage/Driver/Pg/QueryParser.pm 2010-03-24 20:46:31 UTC (rev 15963)
@@ -622,7 +622,7 @@
my $table = $node->table;
my $talias = $node->table_alias;
- $from .= "\n\tJOIN (\n\t\tSELECT * /* facet */\n\t\t FROM $table\n\t\t WHERE value IN (" . join(",", map { $self->QueryParser->quote_value($_) } @{$node->values}) . ")".
+ $from .= "\n\tJOIN (\n\t\tSELECT * /* facet */\n\t\t FROM $table\n\t\t WHERE SUBSTRING(value,1,1024) IN (" . join(",", map { $self->QueryParser->quote_value($_) } @{$node->values}) . ")".
"\n\t\t\tAND field IN (SELECT id FROM config.metabib_field WHERE field_class = ". $self->QueryParser->quote_value($node->classname) ." AND facet_field";
if (@{$node->fields} > 0) {
Modified: trunk/Open-ILS/src/sql/Pg/002.schema.config.sql
===================================================================
--- trunk/Open-ILS/src/sql/Pg/002.schema.config.sql 2010-03-24 20:18:50 UTC (rev 15962)
+++ trunk/Open-ILS/src/sql/Pg/002.schema.config.sql 2010-03-24 20:46:31 UTC (rev 15963)
@@ -59,7 +59,7 @@
install_date TIMESTAMP WITH TIME ZONE NOT NULL DEFAULT NOW()
);
-INSERT INTO config.upgrade_log (version) VALUES ('0208'); -- berick
+INSERT INTO config.upgrade_log (version) VALUES ('0209'); -- miker
CREATE TABLE config.bib_source (
id SERIAL PRIMARY KEY,
Modified: trunk/Open-ILS/src/sql/Pg/030.schema.metabib.sql
===================================================================
--- trunk/Open-ILS/src/sql/Pg/030.schema.metabib.sql 2010-03-24 20:18:50 UTC (rev 15962)
+++ trunk/Open-ILS/src/sql/Pg/030.schema.metabib.sql 2010-03-24 20:46:31 UTC (rev 15963)
@@ -41,6 +41,8 @@
FOR EACH ROW EXECUTE PROCEDURE oils_tsearch2('title');
CREATE INDEX metabib_title_field_entry_index_vector_idx ON metabib.title_field_entry USING GIST (index_vector);
+CREATE INDEX metabib_title_field_entry_value_idx ON metabib.title_field_entry (SUBSTRING(value,1,1024));
+CREATE INDEX metabib_title_field_entry_source_idx ON metabib.title_field_entry (source);
CREATE TABLE metabib.author_field_entry (
@@ -55,6 +57,8 @@
FOR EACH ROW EXECUTE PROCEDURE oils_tsearch2('author');
CREATE INDEX metabib_author_field_entry_index_vector_idx ON metabib.author_field_entry USING GIST (index_vector);
+CREATE INDEX metabib_author_field_entry_value_idx ON metabib.author_field_entry (SUBSTRING(value,1,1024));
+CREATE INDEX metabib_author_field_entry_source_idx ON metabib.author_field_entry (source);
CREATE TABLE metabib.subject_field_entry (
@@ -69,6 +73,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_value_idx ON metabib.subject_field_entry (SUBSTRING(value,1,1024));
CREATE INDEX metabib_subject_field_entry_source_idx ON metabib.subject_field_entry (source);
@@ -84,6 +89,8 @@
FOR EACH ROW EXECUTE PROCEDURE oils_tsearch2('keyword');
CREATE INDEX metabib_keyword_field_entry_index_vector_idx ON metabib.keyword_field_entry USING GIST (index_vector);
+CREATE INDEX metabib_keyword_field_entry_value_idx ON metabib.keyword_field_entry (SUBSTRING(value,1,1024));
+CREATE INDEX metabib_keyword_field_entry_source_idx ON metabib.keyword_field_entry (source);
CREATE TABLE metabib.series_field_entry (
@@ -98,6 +105,8 @@
FOR EACH ROW EXECUTE PROCEDURE oils_tsearch2('series');
CREATE INDEX metabib_series_field_entry_index_vector_idx ON metabib.series_field_entry USING GIST (index_vector);
+CREATE INDEX metabib_series_field_entry_value_idx ON metabib.series_field_entry (SUBSTRING(value,1,1024));
+CREATE INDEX metabib_series_field_entry_source_idx ON metabib.series_field_entry (source);
CREATE TABLE metabib.rec_descriptor (
Added: trunk/Open-ILS/src/sql/Pg/upgrade/0209.schema.metabib.indexing-facets.sql
===================================================================
--- trunk/Open-ILS/src/sql/Pg/upgrade/0209.schema.metabib.indexing-facets.sql (rev 0)
+++ trunk/Open-ILS/src/sql/Pg/upgrade/0209.schema.metabib.indexing-facets.sql 2010-03-24 20:46:31 UTC (rev 15963)
@@ -0,0 +1,17 @@
+BEGIN;
+
+INSERT INTO config.upgrade_log (version) VALUES ('0208');
+
+CREATE INDEX metabib_title_field_entry_value_idx ON metabib.title_field_entry (SUBSTRING(value,1,1024));
+CREATE INDEX metabib_author_field_entry_value_idx ON metabib.author_field_entry (SUBSTRING(value,1,1024));
+CREATE INDEX metabib_subject_field_entry_value_idx ON metabib.subject_field_entry (SUBSTRING(value,1,1024));
+CREATE INDEX metabib_keyword_field_entry_value_idx ON metabib.keyword_field_entry (SUBSTRING(value,1,1024));
+CREATE INDEX metabib_series_field_entry_value_idx ON metabib.series_field_entry (SUBSTRING(value,1,1024));
+
+CREATE INDEX metabib_author_field_entry_source_idx ON metabib.author_field_entry (source);
+CREATE INDEX metabib_keyword_field_entry_source_idx ON metabib.keyword_field_entry (source);
+CREATE INDEX metabib_title_field_entry_source_idx ON metabib.title_field_entry (source);
+CREATE INDEX metabib_series_field_entry_source_idx ON metabib.series_field_entry (source);
+
+COMMIT;
+
More information about the open-ils-commits
mailing list