Actions
Defect #17700
openExcessive DB querying when Allow Group Issue Assignment is enabled
Status:
New
Priority:
Normal
Assignee:
-
Category:
Performance
Target version:
-
Start date:
Due date:
% Done:
0%
Estimated time:
Resolution:
Affected version:
Description
For every issue Redmine runs a separate query to get the roles for every member of the project, but only when Allow Group Issue Assignment is enabled.
In app/models/project.rb:
33: has_many :member_principals, :class_name => 'Member',
34: :include => :principal,
35: :conditions => "#{Principal.table_name}.type='Group' OR (#{Principal.table_name}.type='User' AND #{Principal.table_name}.status=#{Principal::STATUS_ACTIVE})"
changing line 34 to read:
:include => [:principal, :roles],
definitely solves the performance issue, but are there any pitfalls in fixing it that way?
Related issues
Actions