Actions
Patch #23196
closedSpeed up Project.allowed_to_condition
Status:
Closed
Priority:
Normal
Assignee:
Category:
Performance
Target version:
-
Start date:
Due date:
% Done:
0%
Estimated time:
Description
In cases where there are many issues in a project and the Redmine instance has many projects with many enabled modules overall, Project.allowed_to_condition
can get painfully slow (>10 sec for a request in our tests on server grade hardware at Planio with large Redmine databases) because the subselect in source:trunk/app/models/project.rb@15586#L184 will get executed for each of the issues found in the project hierarchy.
Since the list of project ids returned by this query will be static for the scope of the call, it makes sense to cache it. In our tests, this results in a significant speedup (milliseconds vs. seconds).
A patch against current trunk is attached.
Files
Related issues
Actions