From 28a0246a799ad47ec78d4b9d00a3f84b5cc154f0 Mon Sep 17 00:00:00 2001 From: Kyle M Hall Date: Thu, 24 Oct 2013 14:11:59 -0400 Subject: [PATCH] Bug 11136 - action_logs should be a MyISAM table, not InnoDB The table action_logs is written too at a higher rate than practically any other table. Additionally, action_logs has no foreign key constraints. It seems that this would be a somewhat unique situation where using MyISAM would provide quite a performance boost for large sites with many transactions that use the Action Logs. --- installer/data/mysql/kohastructure.sql | 2 +- installer/data/mysql/updatedatabase.pl | 7 +++++++ 2 files changed, 8 insertions(+), 1 deletions(-) diff --git a/installer/data/mysql/kohastructure.sql b/installer/data/mysql/kohastructure.sql index 140c5d8..1342bcb 100644 --- a/installer/data/mysql/kohastructure.sql +++ b/installer/data/mysql/kohastructure.sql @@ -2679,7 +2679,7 @@ CREATE TABLE `action_logs` ( -- logs of actions taken in Koha (requires that the `info` text, -- information about the action (usually includes SQL statement) PRIMARY KEY (`action_id`), KEY (`timestamp`,`user`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8; +) ENGINE=MyISAM DEFAULT CHARSET=utf8; -- -- Table structure for table `alert` diff --git a/installer/data/mysql/updatedatabase.pl b/installer/data/mysql/updatedatabase.pl index b031ed8..f5a6d48 100755 --- a/installer/data/mysql/updatedatabase.pl +++ b/installer/data/mysql/updatedatabase.pl @@ -7330,6 +7330,13 @@ if ( CheckVersion($DBversion) ) { SetVersion($DBversion); } +$DBversion = "3.13.00.XXX"; +if ( CheckVersion($DBversion) ) { + $dbh->do("ALTER TABLE action_logs ENGINE = MYISAM"); + print "Upgrade to $DBversion done (Bug 11136 - action_logs should be a MyISAM table, not InnoDB)\n"; + SetVersion($DBversion); +} + =head1 FUNCTIONS =head2 TableExists($table) -- 1.7.2.5