Bug 17196: Move marcxml out of the biblioitems table
authorJonathan Druart <jonathan.druart@bugs.koha-community.org>
Thu, 25 Aug 2016 10:41:56 +0000 (11:41 +0100)
committerKyle M Hall <kyle@bywatersolutions.com>
Fri, 13 Jan 2017 13:49:26 +0000 (13:49 +0000)
commitc6e488f4af72a2629fd86ee040a6973e2a6c73f4
tree0650655602b51253c4108c2a979949999dc9db2b
parentfdc15cb7623ed2ed8cd2d0b3fcfbd96d90f59041
Bug 17196: Move marcxml out of the biblioitems table

Two discussions on koha-devel lead to the same conclusion:
biblioitems.marcxml should be moved out this table
- biblio and biblioitems
http://lists.koha-community.org/pipermail/koha-devel/2013-April/039239.html
- biblioitems.marcxml & biblioitems.marc / HUGE performance issue !
http://lists.koha-community.org/pipermail/koha-devel/2016-July/042821.html

There are several goals to do it:
- Performance
As Paul Poulain wrote, a simple query like
  SELECT publicationyear, count(publicationyear) FROM biblioitems GROUP BY publicationyear;
takes more than 10min on a DB with more than 1M bibliographic records
but only 3sec (!) on the same DB without the biblioitems.marcxml field
Note that priori to this patch set, the biblioitems.marcxml was not
retrieved systematically, but was, at least, in
C4::Acquisition::GetOrdersByBiblionumber and C4::Acquisition::GetOrders
- Flexibility
Storing the marcxml in a specific table would allow use to store several
kind of metadata (USMARC, MARCXML, MIJ, etc.) and different formats (marcflavour)
- Clean code
It would be a first step toward Koha::MetadataRecord for bibliographic
records (not done in this patch set).

Test plan:
- Update the DBIC Schema
- Add / Edit / Delete / Import / Export bibliographic records
- Add items
- Reindex records using ES
- Confirm that the following scripts still work:
    * misc/cronjobs/delete_records_via_leader.pl
    * misc/migration_tools/build_oai_sets.pl
- Look at the reading history at the OPAC (opac-readingrecord.pl)
- At the OPAC, click on a tag, you must see the result

Note: Changes in Koha/OAI/Server/ListRecords.pm is planned on bug 15108.

Signed-off-by: Mason James <mtj@kohaaloha.com>
Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Signed-off-by: Zeno Tajoli <z.tajoli@cineca.it>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
18 files changed:
C4/Biblio.pm
C4/ILSDI/Services.pm
C4/Members.pm
C4/Overdues.pm
C4/SIP/interactive_item_dump.pl
Koha/Biblio/Metadata.pm [new file with mode: 0644]
Koha/Biblio/Metadatas.pm [new file with mode: 0644]
Koha/BiblioUtils/Iterator.pm
Koha/OAI/Server/ListRecords.pm
misc/cronjobs/delete_records_via_leader.pl
misc/migration_tools/build_oai_sets.pl
opac/opac-readingrecord.pl
opac/opac-search.pl
t/db_dependent/Holds/DisallowHoldIfItemsAvailable.t
t/db_dependent/Holds/HoldFulfillmentPolicy.t
t/db_dependent/Holds/HoldItemtypeLimit.t
t/db_dependent/HoldsQueue.t
t/db_dependent/UsageStats.t