]> git.evergreen-ils.org Git - Evergreen.git/commit
LP#1269911: Database elements of MVF and CRA
authorMike Rylander <mrylander@gmail.com>
Tue, 14 Jan 2014 21:28:04 +0000 (16:28 -0500)
committerDan Wells <dbw2@calvin.edu>
Fri, 21 Feb 2014 20:38:52 +0000 (15:38 -0500)
commitd2b047058e99da0ce2c944643a03b432beb4dda5
treed0475a678c7bc78eaa20eecfc6474958daa1e7a0
parent0bb4915e5129c21a2600eb28205a8f111cba1f2b
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>
Open-ILS/src/sql/Pg/002.schema.config.sql
Open-ILS/src/sql/Pg/012.schema.vandelay.sql
Open-ILS/src/sql/Pg/030.schema.metabib.sql
Open-ILS/src/sql/Pg/950.data.seed-values.sql
Open-ILS/src/sql/Pg/create_database_extensions.sql