stable

Clone or download

Read-only

request #12520 Missing index on svn_commit

Widget svn can trigger slow query, when running SELECT svn_commits.revision as revision, svn_commits.id as commit_id, svn_commits.description as description, svn_commits.date as date, svn_commits.whoid FROM svn_commits WHERE svn_commits.group_id=XXX ORDER BY revision DESC LIMIT 0,5; the only used index is the primary key. If project has many commit it will query all of its commit to retrieve R rows Before adding the index on a customer project: Query time: 5 rows in set (26.58 sec) mysql> SHOW status like 'handler_%'; +----------------------------+---------+ | Variable_name | Value | +----------------------------+---------+ | Handler_read_last | 1 | | Handler_read_prev | 1393205 | After the index: Query time: 5 rows in set (0.00 sec) mysql> SHOW status like 'handler_%'; +----------------------------+-------+ | Variable_name | Value | +----------------------------+-------+ | Handler_read_key | 1 | | Handler_read_prev | 4 | Change-Id: I5eef6ea8bd2e206e819f91b1ece69b8f322abc02

Modified Files

Name
M src/db/mysql/database_structure.sql +1 −0 Go to diff View file
A src/db/mysql/updates/2018/201811091827_add_svn_commit_index.php +37 −0 Go to diff View file