From 829a423e86dd010f34b0a3c24e9a1f560641116b Mon Sep 17 00:00:00 2001 From: Chris Cormack Date: Fri, 4 Sep 2009 16:04:03 +1200 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 Bumping version number for 3.0.4 Conflicts: kohaversion.pl --- 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 f0ab41b8de..ee820c4d6e 100644 --- a/installer/data/mysql/kohastructure.sql +++ b/installer/data/mysql/kohastructure.sql @@ -421,6 +421,7 @@ CREATE TABLE `biblioitems` ( KEY `isbn` (`isbn`), KEY `issn` (`issn`), 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 b7d73ffb46..80bc573e86 100755 --- a/installer/data/mysql/updatedatabase.pl +++ b/installer/data/mysql/updatedatabase.pl @@ -2062,6 +2062,13 @@ if (C4::Context->preference("Version") < TransformToNum($DBversion)) { SetVersion ($DBversion); } +$DBversion = '3.00.04.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 acb9b3c703..4cae625fb7 100644 --- a/kohaversion.pl +++ b/kohaversion.pl @@ -10,7 +10,7 @@ use strict; sub kohaversion { - our $VERSION = '3.00.04.005'; + our $VERSION = '3.00.04.006'; # version needs to be set this way # so that it can be picked up by Makefile.PL # during install -- 2.39.5