Defect #20879
closedDatabase slowdowns without indexes
0%
Description
We're using Redmine for our internal issue tracking system.
Yesterday the site started to get super slow, until it just stopped responding. The CPU on the server was pegged at 100%, and eventually the server would run out of memory and crash.
I created an index on 'enabled_modules'
create index em_name on enabled_modules (name(255));and on 'issue_reads'
create index ir_issues_users on issue_reads (issue_id,user_id);
Now the same query that was killing the server completes in 1.3 seconds.
I also noticed that the query joins the same table (issue_reads) twice, once with a LEFT OUTER JOIN and once with a LEFT JOIN -- each time with the exact same ON conditions. Not sure if that's intentional.
I've attached the MySQL describe output from before the indexes and after.
Redmine version: v2.5.2
MySQL version ( mysql --version ): Ver 14.14 Distrib 5.1.73, for redhat-linux-gnu (x86_64) using readline 5.1
Files