From de4eeac2af2a65f0013850e6051830a739d45783 Mon Sep 17 00:00:00 2001 From: Chris Cormack Date: Tue, 6 Jul 2010 20:58:03 +1200 Subject: [PATCH] Bug 4139 - Adding some indexes to deal with a performance issue with overdue reports Signed-off-by: Galen Charlton --- installer/data/mysql/kohastructure.sql | 6 ++++-- installer/data/mysql/updatedatabase.pl | 8 ++++++++ kohaversion.pl | 2 +- 3 files changed, 13 insertions(+), 3 deletions(-) diff --git a/installer/data/mysql/kohastructure.sql b/installer/data/mysql/kohastructure.sql index d8ed27de14..e42cecd475 100644 --- a/installer/data/mysql/kohastructure.sql +++ b/installer/data/mysql/kohastructure.sql @@ -104,7 +104,8 @@ CREATE TABLE `authorised_values` ( `imageurl` varchar(200) default NULL, PRIMARY KEY (`id`), KEY `name` (`category`), - KEY `lib` (`lib`) + KEY `lib` (`lib`), + KEY `auth_value_idx` (`authorised_value`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; -- @@ -279,7 +280,8 @@ CREATE TABLE `borrower_attribute_types` ( `password_allowed` tinyint(1) NOT NULL default 0, `staff_searchable` tinyint(1) NOT NULL default 0, `authorised_value_category` varchar(10) default NULL, - PRIMARY KEY (`code`) + PRIMARY KEY (`code`), + KEY `auth_val_cat_idx` (`authorised_value_category`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; -- diff --git a/installer/data/mysql/updatedatabase.pl b/installer/data/mysql/updatedatabase.pl index f32d43ca3d..4210328986 100755 --- a/installer/data/mysql/updatedatabase.pl +++ b/installer/data/mysql/updatedatabase.pl @@ -3677,6 +3677,14 @@ if (C4::Context->preference('Version') < TransformToNum($DBversion)){ SetVersion ($DBversion); } +$DBversion = 'XXXX'; +if (C4::Context->preference('Version') < TransformToNum($DBversion)){ + $dbh->do(qq{CREATE INDEX auth_value_idx ON authorised_values (authorised_value)}); + $dbh->do(qq{CREATE INDEX auth_val_cat_idx ON borrower_attribute_types (authorised_value_category)}); + print "Create index on authorised_values and borrower_attribute_types (bug 4139)"; + SetVersion ($DBversion); +} + =item DropAllForeignKeys($table) diff --git a/kohaversion.pl b/kohaversion.pl index d2cf8dbdf8..04bf49386a 100644 --- a/kohaversion.pl +++ b/kohaversion.pl @@ -11,7 +11,7 @@ use strict; sub kohaversion { - our $VERSION = '3.01.00.142'; + our $VERSION = 'XXXX'; # version needs to be set this way # so that it can be picked up by Makefile.PL -- 2.39.5