Project

General

Profile

Actions

Defect #17700

open

Excessive DB querying when Allow Group Issue Assignment is enabled

Added by Basile Vorontsov over 10 years ago. Updated over 9 years ago.

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

Related to Redmine - Defect #14906: Excessive queries on roles table when show a IssueResolved

Actions
Actions #1

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
Actions #2

Updated by redmineservices . over 9 years ago

This problem also occurs when you have a custom field with user format.

Actions

Also available in: Atom PDF