Bugzilla – Attachment 78307 Details for
Bug 21288
Slowness in acquisition caused by GetInvoices
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 21288: Slowness in acquisition caused by GetInvoices
0001-Bug-21288-Slowness-in-acquisition-caused-by-GetInvoi.patch (text/plain), 2.20 KB, created by
paxed
on 2018-08-30 08:35:24 UTC
(
hide
)
Description:
Bug 21288: Slowness in acquisition caused by GetInvoices
Filename:
MIME Type:
Creator:
paxed
Created:
2018-08-30 08:35:24 UTC
Size:
2.20 KB
patch
obsolete
>From 9e9348ab7d7d6de5eefa61a1e8cb398626626e03 Mon Sep 17 00:00:00 2001 >From: Pasi Kallinen <pasi.kallinen@joensuu.fi> >Date: Thu, 30 Aug 2018 11:29:54 +0300 >Subject: [PATCH] Bug 21288: Slowness in acquisition caused by GetInvoices > >The SQL query done by GetInvoices is quite slow on our production server, >taking about a minute. > >In the query, there's this join: > > LEFT JOIN subscription ON biblio.biblionumber = subscription.biblionumber > >but there's no index on subscription.biblionumber. Adding the index speeds >up the query so it only takes up about 3 seconds. > >Signed-off-by: Pasi Kallinen <pasi.kallinen@joensuu.fi> >--- > installer/data/mysql/atomicupdate/bug_21288.perl | 9 +++++++++ > installer/data/mysql/kohastructure.sql | 1 + > 2 files changed, 10 insertions(+) > create mode 100644 installer/data/mysql/atomicupdate/bug_21288.perl > >diff --git a/installer/data/mysql/atomicupdate/bug_21288.perl b/installer/data/mysql/atomicupdate/bug_21288.perl >new file mode 100644 >index 0000000000..a4a102a64e >--- /dev/null >+++ b/installer/data/mysql/atomicupdate/bug_21288.perl >@@ -0,0 +1,9 @@ >+$DBversion = 'XXX'; # will be replaced by the RM >+if( CheckVersion( $DBversion ) ) { >+ $dbh->do(q{ >+ CREATE INDEX `by_biblionumber` ON `subscription` (`biblionumber`) >+ }); >+ >+ SetVersion( $DBversion ); >+ print "Upgrade to $DBversion done (Bug 21288: Slowness in acquisition caused by GetInvoices\n"; >+} >diff --git a/installer/data/mysql/kohastructure.sql b/installer/data/mysql/kohastructure.sql >index a15d4164de..c62df00158 100644 >--- a/installer/data/mysql/kohastructure.sql >+++ b/installer/data/mysql/kohastructure.sql >@@ -2115,6 +2115,7 @@ CREATE TABLE `subscription` ( -- information related to the subscription > `itemtype` VARCHAR( 10 ) NULL, > `previousitemtype` VARCHAR( 10 ) NULL, > PRIMARY KEY (`subscriptionid`), >+ KEY `by_biblionumber` (`biblionumber`), > CONSTRAINT subscription_ibfk_1 FOREIGN KEY (periodicity) REFERENCES subscription_frequencies (id) ON DELETE SET NULL ON UPDATE CASCADE, > CONSTRAINT subscription_ibfk_2 FOREIGN KEY (numberpattern) REFERENCES subscription_numberpatterns (id) ON DELETE SET NULL ON UPDATE CASCADE > ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; >-- >2.11.0 >
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 21288
:
78306
|
78307
|
78708
|
78856