The SQL query done by GetInvoices is quite slow on our production server. # Query_time: 55.436404 Lock_time: 0.000097 Rows_sent: 231 Rows_examined: 190484 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.
Created attachment 78306 [details] Data for the query from MySQL Explain
Created attachment 78307 [details] [review] 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.
Very glad you reported and investigated this - we had quite some trouble with invoices search in one of our installations. Will try to test!
Created attachment 78708 [details] [review] 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>
Created attachment 78856 [details] [review] 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> Signed-off-by: Chris Cormack <chris@bigballofwax.co.nz>
Awesome work all! Pushed to master for 18.11
Pushed to 18.05.x for 18.05.04
Pushed to 17.11.x for 17.11.10