From cf3bd149e53585676a517d38093f2470dbcfaaeb Mon Sep 17 00:00:00 2001 From: Dan Wells Date: Wed, 1 Jun 2016 14:36:29 -0400 Subject: [PATCH] LP#1588543: Speed up record attribute ingest A huge number of rows (700+) have been added to config.record_attr_definition in recent versions of Evergreen. However, these rows do not actually define any indexing at all, but are used for other purposes. The reingest process currently churns over all of these rows to ultimately do nothing. This commit limits the group of attributes considered at ingest to only those which might index something. Testing indicates a substantial speed boost to typical use of metabib.reingest_record_attributes() (over 2x speedup). Signed-off-by: Dan Wells Signed-off-by: Galen Charlton Signed-off-by: Mike Rylander --- Open-ILS/src/sql/Pg/030.schema.metabib.sql | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/Open-ILS/src/sql/Pg/030.schema.metabib.sql b/Open-ILS/src/sql/Pg/030.schema.metabib.sql index 0d3fb006fb..1c922fa3e4 100644 --- a/Open-ILS/src/sql/Pg/030.schema.metabib.sql +++ b/Open-ILS/src/sql/Pg/030.schema.metabib.sql @@ -1346,7 +1346,16 @@ DECLARE BEGIN IF attr_list IS NULL OR rdeleted THEN -- need to do the full dance on INSERT or undelete - SELECT ARRAY_AGG(name) INTO attr_list FROM config.record_attr_definition; + SELECT ARRAY_AGG(name) INTO attr_list FROM config.record_attr_definition + WHERE ( + tag IS NOT NULL OR + fixed_field IS NOT NULL OR + xpath IS NOT NULL OR + phys_char_sf IS NOT NULL OR + composite + ) AND ( + filter OR sorter + ); END IF; IF rmarc IS NULL THEN -- 2.43.2