Feature #23987

Add an index on issues.parent_id

Added by Jérôme BATAILLE 8 months ago. Updated 5 months ago.

Status:ClosedStart date:
Priority:NormalDue date:
Assignee:Jean-Philippe Lang% Done:

0%

Category:Performance
Target version:3.4.0
Resolution:Fixed

Description

Hi,

We encounter slowness with using the scrum plugin (https://redmine.ociotec.com/projects/redmine-plugin-scrum).
It happens when dragging issue in the backlog.
It seems that the slowness comes from the fact that there is no index on the parent_id field of the issues table :
Here we have more than 500.000 issues
and for example a simple SELECT COUNT(*) FROM `issues` WHERE `issues`.`parent_id` = 520784 takes 0.28 seconds
The slow method is all_dependent_issues.

Aside from the use of this plugin, on issues with children, a request is made on the parent_id field, that takes a few hundreds of milli-seconds.
We have added an index on that field, that fixes the issue.

Can this index be added by default in the Redmine migrations ?

Thanks a lot

Associated revisions

Revision 16103
Added by Jean-Philippe Lang 5 months ago

Adds an index on issues parent_id (#23987).

History

#1 Updated by Toshi MARUYAMA 7 months ago

  • Target version set to 3.4.0

#2 Updated by Jean-Philippe Lang 5 months ago

  • Subject changed from Issue table : add index on parent_id like on root_id_and_lft_and_rgt to Add an index on issues.parent_id
  • Status changed from New to Closed
  • Assignee set to Jean-Philippe Lang
  • Resolution set to Fixed

Added in r16103.

#3 Updated by Jérôme BATAILLE 5 months ago

Thanks a lot !

Also available in: Atom PDF