Some table columns should have an index to speed SQL queries : - statistics table has only one index (used to make heavy queries for reports) - itemtype should have an index in items and biblioitems (this is used in circulation to check the number of existing issues of a specific item type) - issue.branchcode and issue.issuingbranch Note that the fact that an index is automatically created for foreign keys in InnoBD seems to be in discussion, so better create it explicitly.
Created attachment 15583 [details] [review] Proposed patch See commit message
Created attachment 15590 [details] [review] Proposed patch (better udpate message)
Created attachment 15642 [details] [review] [SIGNED-OFF] Bug 9681: Add some indexes in database Some table columns should have an index to speed SQL queries : - statistics table has only one index (used to make heavy queries for reports) - itemtype should have an index in items and biblioitems (this is used in circulation to check the number of existing issues of a specific item type) - issue.branchcode and issue.issuingbranch Test plan : - Create a new database using kohastructure.pl => check there is no SQL error and that new indexes are present (mysql> show create table) Apply update database on a master version => check there is no SQL error and that new indexes are present (mysql> show create table) Signed-off-by: Bernardo Gonzalez Kriegel <bgkriegel@gmail.com> Comment: Indexes created as described. No errors. Fixing small merge conflict. Test presence of new indexes on all affected tables.
QA comments : * this patch just adds some indexes, no possible side effect * it will speed up a lot some of the statistics SQL queries, so bumping severity from "ENH" to "NOR". Including this patch for 3.12 is RM choice, but I think it's worth it * tested updatedatabase and kohastructure.sql, everything OK Passed QA
Created attachment 17959 [details] [review] Bug 9681: Add some indexes in database Some table columns should have an index to speed SQL queries : - statistics table has only one index (used to make heavy queries for reports) - itemtype should have an index in items and biblioitems (this is used in circulation to check the number of existing issues of a specific item type) - issue.branchcode and issue.issuingbranch Test plan : - Create a new database using kohastructure.pl => check there is no SQL error and that new indexes are present (mysql> show create table) Apply update database on a master version => check there is no SQL error and that new indexes are present (mysql> show create table) Signed-off-by: Bernardo Gonzalez Kriegel <bgkriegel@gmail.com> Comment: Indexes created as described. No errors. Fixing small merge conflict. Test presence of new indexes on all affected tables. Signed-off-by: Paul Poulain <paul.poulain@biblibre.com>
This patch has been pushed to master and 3.12.x.
Can it been pushed to 3.10 ?