From d3688945450f5034a906790d31663f0d45cdff82 Mon Sep 17 00:00:00 2001 From: Galen Charlton Date: Thu, 11 Dec 2008 11:59:55 -0600 Subject: [PATCH] bug 2859: add index on bibioitems.issn (DB rev 006) 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 --- installer/data/mysql/kohastructure.sql | 1 + installer/data/mysql/updatedatabase.pl | 7 +++++++ kohaversion.pl | 2 +- 3 files changed, 9 insertions(+), 1 deletion(-) diff --git a/installer/data/mysql/kohastructure.sql b/installer/data/mysql/kohastructure.sql index fa93a059a3..b2e7515e85 100644 --- a/installer/data/mysql/kohastructure.sql +++ b/installer/data/mysql/kohastructure.sql @@ -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; diff --git a/installer/data/mysql/updatedatabase.pl b/installer/data/mysql/updatedatabase.pl index 6c14e974dd..fdebcf9fa6 100755 --- a/installer/data/mysql/updatedatabase.pl +++ b/installer/data/mysql/updatedatabase.pl @@ -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 diff --git a/kohaversion.pl b/kohaversion.pl index a6eaa26f39..12d23eb064 100644 --- a/kohaversion.pl +++ b/kohaversion.pl @@ -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 -- 2.39.5