bug 2859: add index on bibioitems.issn (DB rev 006)
authorGalen Charlton <galen.charlton@liblime.com>
Thu, 11 Dec 2008 17:59:55 +0000 (11:59 -0600)
committerGalen Charlton <galen.charlton@liblime.com>
Fri, 12 Dec 2008 16:13:05 +0000 (10:13 -0600)
Because of a query on biblioitems.issn in
C4::Breeding::ImportBreeding(), libraries doing a lot
of bib imports were experiencing performance problems,
which adding an index will alleviate.

A possible longer term solution is to index all
reservoir/import batch records in a Zebra database.

[LL bug 232]

Signed-off-by: Galen Charlton <galen.charlton@liblime.com>
installer/data/mysql/kohastructure.sql
installer/data/mysql/updatedatabase.pl
kohaversion.pl

index fa93a05..b2e7515 100644 (file)
@@ -420,6 +420,7 @@ CREATE TABLE `biblioitems` (
   KEY `bibnoidx` (`biblionumber`),
   KEY `isbn` (`isbn`),
   KEY `publishercode` (`publishercode`),
+  KEY `issn` (`issn`),
   CONSTRAINT `biblioitems_ibfk_1` FOREIGN KEY (`biblionumber`) REFERENCES `biblio` (`biblionumber`) ON DELETE CASCADE ON UPDATE CASCADE
 ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
 
index 6c14e97..fdebcf9 100755 (executable)
@@ -2060,6 +2060,13 @@ if (C4::Context->preference("Version") < TransformToNum($DBversion)) {
     SetVersion ($DBversion);
 }
 
+$DBversion = '3.01.00.006';
+if (C4::Context->preference("Version") < TransformToNum($DBversion)) {
+    $dbh->do("ALTER TABLE `biblioitems` ADD KEY issn (issn)");
+    print "Upgrade to $DBversion done (add index on biblioitems.issn)\n";
+    SetVersion ($DBversion);
+}
+
 =item DropAllForeignKeys($table)
 
   Drop all foreign keys of the table $table
index a6eaa26..12d23eb 100644 (file)
@@ -10,7 +10,7 @@
 use strict;
 
 sub kohaversion {
-    our $VERSION = '3.01.00.005';
+    our $VERSION = '3.01.00.006';
     # version needs to be set this way
     # so that it can be picked up by Makefile.PL
     # during install