LP#
1269911: Database elements of MVF and CRA
* Teach vandelay.marc21_physical_characteristics() to see all 007's
We use vandelay.marc21_physical_characteristics() to extract fixed
field data that lives in the 007. Before this change, it would
only look at the first 007 in the record. Now it will look at
all of them in turn, supporting configurations such as DVD+BluRay.
* Add intarray extension
We need intarray for GIN index support of integer arrays, which is
how we'll be storing the in-use record attribute value identifiers.
* Hidy hole in which to stick "uncontrolled" values
In order to make use of the massive speed increases provided by
intarray indexing, we need to use (you guessed it) integers. But
uncontrolled record attributes are not necessarily (or even very
often) numbers. We will store them in a table of unique (per
attribute) values, and use the id from that table in our intarray
indexing. That id comes from a DECREMENTING serial that starts
at -1 and counts downward. This avoids collision with the other
set of integers (the id from config.coded_value_map) that we will
use for controlled record attribute values.
* Add a multi flag for record attrs
We pre-coordinate which record attrs are allowed to be multi-valued
with this new bool. Most can be, we set the default to true and
adjust the seed data for those that should be false (sorters and
fields in the leader).
* New intarray-focused attribute extraction
We rewrite the record attribute extraction to capture all the
record-supplied values for each attribute (where multi is true)
and store that list in the new (fkey-corrected) metabib.record_attr_vector_list
table. Only filters make it into this table.
We also insert a parameter after the record id to accept a list of
record attributes we want to rewrite. This defaults to NULL to rewrite
all of them.
Sorters are stored in a new, separate table built specifically for them.
metabib.record_attr becomes a vew atop metabib.record_attr_vector_list
which expands the intarray stored therein into an hstore. For
multi=true attributes, only one will be returned through this view,
as is HSTORE's way, and which will be returned is undefined. However
this view is only provided for the purpose of backward compat with
reports or other locally defined logic.
And, finally, baseline seed data
Signed-off-by: Mike Rylander <mrylander@gmail.com>
Signed-off-by: Dan Wells <dbw2@calvin.edu>