View Issue Details
| ID | Project | Category | View Status | Date Submitted | Last Update |
|---|---|---|---|---|---|
| 0005458 | mantisbt | custom fields | public | 2005-04-20 02:59 | 2005-07-23 02:22 |
| Reporter | russ | Assigned To | thraxisp | ||
| Priority | normal | Severity | major | Reproducibility | always |
| Status | closed | Resolution | duplicate | ||
| Product Version | 1.0.0a1 | ||||
| Summary | 0005458: Slow queries on projects with many bugs and custom fields | ||||
| Description | Slow query pulled from viewing the processlist in mysql: SELECT DISTINCT mantis_bug_table.id AS id FROM mantis_project_table, mantis_bug_table LEFT JOIN mantis_custom_field_string_table mantis_custom_field_string_table_3 ON mantis_custom_field_string_table_3.bug_id = mantis_bug_table.id LEFT JOIN mantis_custom_field_string_table mantis_custom_field_string_table_2 ON mantis_custom_field_string_table_2.bug_id = mantis_bug_table.id WHERE mantis_project_table.enabled = 1 AND mantis_project_table.id = mantis_bug_table.project_id AND ( mantis_bug_table.project_id=2 ) AND (mantis_bug_table.view_state='10' OR mantis_bug_table.reporter_id='75') The interesting thing is that the custom fields have no constraints set. I think they could be left out of the query. I fixed the slow queries on my setup by adding an index. I am running a recent checkout from cvs HEAD. Added following index and the query returns in less 0.1 secs vs. ~60 secs on my system. "alter table mantis_custom_field_string_table add index bug_id_idx (bug_id);" The primary key does include bug_id, but it is the second field in the index therefore mysql does not use it for the query. | ||||
| Tags | No tags attached. | ||||