Bugzilla – Attachment 78708 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
Bug-21288-Slowness-in-acquisition-caused-by-GetInv.patch (text/plain), 2.24 KB, created by
Mark Tompsett
on 2018-09-14 19:02:05 UTC
(
hide
)
Description:
Bug 21288: Slowness in acquisition caused by GetInvoices
Filename:
MIME Type:
Creator:
Mark Tompsett
Created:
2018-09-14 19:02:05 UTC
Size:
2.24 KB
patch
obsolete
>From 8eefbe84f9bac331a8f6e94dd83edb072b1ecc03 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> > >Signed-off-by: Mark Tompsett <mtompset@hotmail.com> >--- > 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 0000000..a4a102a >--- /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 3048ade..da6d7f6 100644 >--- a/installer/data/mysql/kohastructure.sql >+++ b/installer/data/mysql/kohastructure.sql >@@ -2098,6 +2098,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.7.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 21288
:
78306
|
78307
|
78708
|
78856