]> git.koha-community.org Git - koha.git/commit
Bug 11249: Add Db indexes on borrowers names
authorFridolyn SOMERS <fridolyn.somers@biblibre.com>
Thu, 14 Nov 2013 13:29:51 +0000 (14:29 +0100)
committerFridolin Somers <fridolin.somers@biblibre.com>
Mon, 27 Jan 2014 11:24:32 +0000 (12:24 +0100)
commit1864a4d61eb87ceeccc39bb8bd5e5214e5a4ffe5
tree74e4e7a57697dd57d4400a62af90b23f81307bf6
parent227cb1570f9b08bd2e3903cca54ecc5570be5d6d
Bug 11249: Add Db indexes on borrowers names

The borrowers search is by default on columns surname, firstname,
othernames and cardnumber.

(See C4::Members::_express_member_find).

Adding DB indexes will really increase the query speed.

This patch adds DB indexes on surname, firstname, othernames (cardnumber
has already an index).

Those indexes must be defined with a size because columns are mediumtext.

Test plan :
Test with mysql client :
mysql> explain select * from borrowers where surname like 'A%';
+----+-------------+-----------+-------+---------------+-------------+---------+------+------+-------------+
| id | select_type | table     | type  | possible_keys | key         | key_len | ref  | rows | Extra       |
+----+-------------+-----------+-------+---------------+-------------+---------+------+------+-------------+
|  1 | SIMPLE      | borrowers | range | surname_idx   | surname_idx | 767     | NULL |  395 | Using where |
+----+-------------+-----------+-------+---------------+-------------+---------+------+------+-------------+
=> key show the index is used

Signed-off-by: Mathieu Saby <mathieu.saby@univ-rennes2.fr>
Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Works as described, changes from updatedatabase and in kohastructure match.
I think deletedborrowers can be left out, as it's not queried when doing
patron searches. Patron deletes still work as expected.

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
(cherry picked from commit 19b5c9b4cecf935c1cf17649796debe80ae7b3a8)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
installer/data/mysql/kohastructure.sql
installer/data/mysql/updatedatabase.pl