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>
Thu, 13 Jun 2013 14:45:06 +0000 (10:45 -0400)
commita0e4af805bc3619d8117936e96237cd6be8e8fdc
tree52662869d0e883d2f08f65d4f26c42f103c64d09
parentf09c41128d79cf68770b52bf89cba73c0f2d8ad8
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