Project

General

Profile

Actions

Defect #17700

open

Excessive DB querying when Allow Group Issue Assignment is enabled

Defect #17700: Excessive DB querying when Allow Group Issue Assignment is enabled

Added by Basile Vorontsov over 12 years ago. Updated over 11 years ago.

Status:
New
Priority:
Normal
Assignee:
-
Category:
Performance
Target version:
-
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 1 (1 open — 0 closed)

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

Updated by Jan Niggemann (redmine.org team member) over 12 years ago Actions #1

  • Related to Defect #14906: Excessive queries on roles table when show a Issue added

Updated by redmineservices . over 11 years ago Actions #2

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

Actions

Also available in: PDF Atom