From 5e1686e78da16fd896151f262dcb86c2b774022b Mon Sep 17 00:00:00 2001 From: Bill Erickson Date: Thu, 28 Dec 2017 11:51:29 -0500 Subject: [PATCH] JBAS-1932 New headings mattype sql speed improvements Join the mattype data via a more direct path instead of the nested views. Signed-off-by: Bill Erickson --- KCLS/sql/schema/deploy/new-headings-mattype.sql | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/KCLS/sql/schema/deploy/new-headings-mattype.sql b/KCLS/sql/schema/deploy/new-headings-mattype.sql index f073b052e0..3ebc0dbbe6 100644 --- a/KCLS/sql/schema/deploy/new-headings-mattype.sql +++ b/KCLS/sql/schema/deploy/new-headings-mattype.sql @@ -11,7 +11,7 @@ SELECT entry.*, usr.usrname AS bib_editor_usrname, evergreen.marc_tag_to_string('1', bre.marc) AS bib_marc_1xx, evergreen.marc_tag_to_string('245', bre.marc) AS bib_marc_245, - rec_attr.attrs -> 'mattype' AS mattype, + ccvm.code AS mattype, (reporter.metabib_browse_entry_window_prev( entry.browse_axis, entry.entry_sort_value)).*, (reporter.metabib_browse_entry_window_next( @@ -19,7 +19,9 @@ SELECT entry.*, FROM reporter.cataloged_browse_entry_combined entry JOIN config.metabib_field cmf ON (cmf.id = entry.field_def) JOIN biblio.record_entry bre ON (bre.id = entry.bib_record) - JOIN metabib.record_attr rec_attr ON (rec_attr.id = bre.id) + JOIN metabib.record_attr_vector_list vec ON (vec.source = bre.id) + JOIN config.coded_value_map ccvm + ON (ccvm.ctype = 'mattype' AND ccvm.id = ANY (vec.vlist)) JOIN actor.usr usr ON (usr.id = bre.editor) ORDER BY CASE entry.browse_axis -- 2.11.0