プロジェクト

全般

プロフィール

Vote #75503

未完了

Excessive DB querying when Allow Group Issue Assignment is enabled

Admin Redmine さんが約4年前に追加. 約4年前に更新.

ステータス:
New
優先度:
通常
担当者:
-
カテゴリ:
Performance_53
対象バージョン:
-
開始日:
2022/05/09
期日:
進捗率:

0%

予定工数:
category_id:
53
version_id:
0
issue_org_id:
17700
author_id:
109236
assigned_to_id:
0
comments:
2
status_id:
1
tracker_id:
1
plus1:
0
affected_version:
closed_on:
affected_version_id:
84
ステータス-->[New]

説明

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?


journals

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


related_issues

relates,Resolved,14906,Excessive queries on roles table when show a Issue

他の形式にエクスポート: Atom PDF

いいね!0
いいね!0