Defect #17700
openExcessive DB querying when Allow Group Issue Assignment is enabled
0%
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
Updated by Jan Niggemann (redmine.org team member) over 10 years ago
- Related to Defect #14906: Excessive queries on roles table when show a Issue added
Updated by redmineservices . over 9 years ago
This problem also occurs when you have a custom field with user format.