Bugzilla – Attachment 64764 Details for
Bug 18861
branch_transfer_limits needs keys
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 18861 - branch_transfer_limits needs keys
Bug-18861---branchtransferlimits-needs-keys.patch (text/plain), 2.25 KB, created by
Alex Buckley
on 2017-07-01 22:02:30 UTC
(
hide
)
Description:
Bug 18861 - branch_transfer_limits needs keys
Filename:
MIME Type:
Creator:
Alex Buckley
Created:
2017-07-01 22:02:30 UTC
Size:
2.25 KB
patch
obsolete
>From f0ef2ce612e8f2844e7f1bd9ae89042c5f93e329 Mon Sep 17 00:00:00 2001 >From: Fridolin Somers <fridolin.somers@biblibre.com> >Date: Tue, 27 Jun 2017 14:54:46 +0200 >Subject: [PATCH] Bug 18861 - branch_transfer_limits needs keys > >The branch transfers limits are edited in : /cgi-bin/koha/admin/branch_transfer_limits.pl >This page calls a loop on IsBranchTransferAllowed with all destination branches and codes (ccodes or itemtypes). > >This can takes a huge time because table branch_transfer_limits has no keys. > >Since ccode or itemtype may be used, this patch adds a key on both combinaison : ccode/fromBranch/toBranch and itemtype/fromBranch/toBranch. > >Tested on a table with 66000 entries, time whent from 26 second to less than 1 second. > >Test plan : >- Go to Administration > Library transfer limits >- Check page load is faster >- Uncheck a checkbox >- Save >=> Verify save is OK >- Change branch and same tests > >Followed test plan which worked as intended >Signed-off-by: Alex Buckley <alexbuckley@catalyst.net.nz> >--- > installer/data/mysql/atomicupdate/bug_18861.sql | 2 ++ > installer/data/mysql/kohastructure.sql | 4 +++- > 2 files changed, 5 insertions(+), 1 deletion(-) > create mode 100644 installer/data/mysql/atomicupdate/bug_18861.sql > >diff --git a/installer/data/mysql/atomicupdate/bug_18861.sql b/installer/data/mysql/atomicupdate/bug_18861.sql >new file mode 100644 >index 0000000..6f17c67 >--- /dev/null >+++ b/installer/data/mysql/atomicupdate/bug_18861.sql >@@ -0,0 +1,2 @@ >+ALTER TABLE branch_transfer_limits ADD KEY `itemtype_idx` (`itemtype`,`fromBranch`,`toBranch`); >+ALTER TABLE branch_transfer_limits ADD KEY `ccode_idx` (`ccode`,`fromBranch`, `toBranch`); >diff --git a/installer/data/mysql/kohastructure.sql b/installer/data/mysql/kohastructure.sql >index e9c60aa..4064fe4 100644 >--- a/installer/data/mysql/kohastructure.sql >+++ b/installer/data/mysql/kohastructure.sql >@@ -2667,7 +2667,9 @@ CREATE TABLE branch_transfer_limits ( > fromBranch varchar(10) NOT NULL, > itemtype varchar(10) NULL, > ccode varchar(10) NULL, >- PRIMARY KEY (limitId) >+ PRIMARY KEY (limitId), >+ KEY `itemtype_idx` (`itemtype`,`fromBranch`,`toBranch`), >+ KEY `ccode_idx` (`ccode`,`fromBranch`, `toBranch`) > ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; > > -- >-- >2.1.4
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 18861
:
64676
|
64764
|
114686