Retain index granularity with minimal bloat
authorDan Scott <dscott@laurentian.ca>
Thu, 13 Jun 2013 05:16:23 +0000 (01:16 -0400)
committerDan Scott <dscott@laurentian.ca>
Wed, 26 Jun 2013 16:44:24 +0000 (12:44 -0400)
commit12207d97c218f518b3f8b1a0e5cb086b828dcc56
tree5c897bb8fd8d58e1af140058d6f47db611c61b15
parent30f0c7ac161161f2dc7a59d82d504e6a4f803802
Retain index granularity with minimal bloat

The previous approach to reducing index bloat arguably went too far, in
that analytics such as separately catalogued songs for an album were all
simply aggregated together in a single metabib.title_field_entry row,
rather than being added as separated metabib.title_field_entry rows for
each unique value.

To avoid the original problem of exact duplicate rows being inserted, we
now check for an existing matching row before inserting into the index.
A good test record is title "Cello concerto." which results in 1 title
proper row and 4 added entry title rows in metabib.title_field_entry
after this change.

Signed-off-by: Dan Scott <dscott@laurentian.ca>
Open-ILS/src/sql/Pg/030.schema.metabib.sql