Bugzilla – Attachment 23866 Details for
Bug 3445
action_logs table needs some thought
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
[PASSED QA] Bug 3445 - action_logs table needs indexes
PASSED-QA-Bug-3445---actionlogs-table-needs-indexe.patch (text/plain), 2.76 KB, created by
Katrin Fischer
on 2013-12-29 20:42:54 UTC
(
hide
)
Description:
[PASSED QA] Bug 3445 - action_logs table needs indexes
Filename:
MIME Type:
Creator:
Katrin Fischer
Created:
2013-12-29 20:42:54 UTC
Size:
2.76 KB
patch
obsolete
>From f1136f0abe476494feeaa6978fba2faa966043d7 Mon Sep 17 00:00:00 2001 >From: Fridolyn SOMERS <fridolyn.somers@biblibre.com> >Date: Tue, 19 Nov 2013 11:21:13 +0100 >Subject: [PATCH] [PASSED QA] Bug 3445 - action_logs table needs indexes > >This patch adds database indexes for action_logs table to speed up "log viewer" page. >Removes the existing index on timestamp+user to add an indexe on each column since earch colums is separately defined in log viewer form. > >Test plan: >- Update database >- Play with log viewer : /cgi-bin/koha/tools/viewlog.pl >- Perform searches with only one filter defined >- Also check you see indexes with SQL query : SHOW CREATE TABLE action_logs > >Signed-off-by: Mathieu Saby <mathieu.saby@univ-rennes2.fr> > >Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de> >Rephrased the updatedatabase message a bit: >Add indexes to action_logs table >Passes all tests and QA script. >--- > installer/data/mysql/kohastructure.sql | 7 ++++++- > installer/data/mysql/updatedatabase.pl | 16 ++++++++++++++++ > 2 files changed, 22 insertions(+), 1 deletion(-) > >diff --git a/installer/data/mysql/kohastructure.sql b/installer/data/mysql/kohastructure.sql >index 136104f..bc3d206 100644 >--- a/installer/data/mysql/kohastructure.sql >+++ b/installer/data/mysql/kohastructure.sql >@@ -2741,7 +2741,12 @@ CREATE TABLE `action_logs` ( -- logs of actions taken in Koha (requires that the > `object` int(11) default NULL, -- the object that the action was taken against (could be a borrowernumber, itemnumber, etc) > `info` text, -- information about the action (usually includes SQL statement) > PRIMARY KEY (`action_id`), >- KEY (`timestamp`,`user`) >+ KEY `timestamp_idx` (`timestamp`), >+ KEY `user_idx` (`user`), >+ KEY `module_idx` (`module`(255)), >+ KEY `action_idx` (`action`(255)), >+ KEY `object_idx` (`object`), >+ KEY `info_idx` (`info`(255)) > ) ENGINE=InnoDB DEFAULT CHARSET=utf8; > > -- >diff --git a/installer/data/mysql/updatedatabase.pl b/installer/data/mysql/updatedatabase.pl >index d0255a4..4ed27af 100755 >--- a/installer/data/mysql/updatedatabase.pl >+++ b/installer/data/mysql/updatedatabase.pl >@@ -7885,6 +7885,22 @@ if(CheckVersion($DBversion)) { > SetVersion($DBversion); > } > >+$DBversion = "3.15.00.XXX"; >+if(CheckVersion($DBversion)) { >+ $dbh->do(q{ >+ ALTER TABLE `action_logs` >+ DROP KEY timestamp, >+ ADD KEY `timestamp_idx` (`timestamp`), >+ ADD KEY `user_idx` (`user`), >+ ADD KEY `module_idx` (`module`(255)), >+ ADD KEY `action_idx` (`action`(255)), >+ ADD KEY `object_idx` (`object`), >+ ADD KEY `info_idx` (`info`(255)) >+ }); >+ print "Upgrade to $DBversion done (Bug 3445: Add indexes to action_logs table)\n"; >+ SetVersion($DBversion); >+} >+ > =head1 FUNCTIONS > > =head2 TableExists($table) >-- >1.8.3.2
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 3445
:
23024
|
23222
| 23866