LP#1588543: further speed up record attribute ingest
authorGalen Charlton <gmc@esilibrary.com>
Fri, 29 Jul 2016 15:24:07 +0000 (11:24 -0400)
committerGalen Charlton <gmc@esilibrary.com>
Fri, 29 Jul 2016 15:24:07 +0000 (11:24 -0400)
Following a suggestion from Dan Wells, this patch adds
an index on config.coded_value_map(ctype). My testing shows
that the index by itself can halve the time required to
fully ingest a new record; in conjunction with the
change in the previous patch, full reingest time is
reduced by about 60%.

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
Open-ILS/src/sql/Pg/002.schema.config.sql

index 2cc6ff5..6496af7 100644 (file)
@@ -821,6 +821,8 @@ CREATE TABLE config.coded_value_map (
                             -- coded value represents
 );
 
+CREATE INDEX config_coded_value_map_ctype_idx ON config.coded_value_map (ctype);
+
 CREATE VIEW config.language_map AS SELECT code, value FROM config.coded_value_map WHERE ctype = 'item_lang';
 CREATE VIEW config.bib_level_map AS SELECT code, value FROM config.coded_value_map WHERE ctype = 'bib_level';
 CREATE VIEW config.item_form_map AS SELECT code, value FROM config.coded_value_map WHERE ctype = 'item_form';