Bug 14053: Acquisition db tables are missing indexes
authorFridolin Somers <fridolin.somers@biblibre.com>
Thu, 23 Apr 2015 15:38:03 +0000 (17:38 +0200)
committerTomas Cohen Arazi <tomascohen@gmail.com>
Mon, 8 Jun 2015 13:49:19 +0000 (10:49 -0300)
commita6017d87f16266e8947b046427537bdcae5a0699
treeea5eed5d160e1c97cc11d57b07a57881c4d976cb
parent9ce2cd7082a2577278c3a7078f9e277cfa683ae9
Bug 14053: Acquisition db tables are missing indexes

Acquisition db tables are missing some indexes to have
performance queries.

This patch adds an index on some columns very often
used in search queries, such as aqbooksellers.name and
aqbudgets.budget_code.

Also adds an index on aqorders.orderstatus, very often used
with hardcoded value like 'cancelled', in various queries.

Test plan :
1) Back up database
2) $ git reset --hard origin/master
3) $ git bz apply 14053
4) In your mysql client
   > DROP DATABASE koha_library;
   > CREATE DATABASE koha_library;
   > QUIT;
   -- Obviously you may need to vary koha_library :)
5) Navigate to staff client
   -- should be able to set up the DB just fine.
   -- this will catch the comma bug that keeps coming in.
6) $ git reset --hard origin/master
7) Repeat step 4
8) Navigate to staff client
   -- nothing tested, but we need the DB set up.
9) $ ./installer/data/mysql/updatedatabase.pl
   -- atomic updates run without issue.
10) run koha qa test tools
11) Restore DB
12) Try to compare performance after and before
    database update. I think query contained in
    C4::Acquistion::GetInvoices could be a good example

Signed-off-by: Mark Tompsett <mtompset@hotmail.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
installer/data/mysql/kohastructure.sql