Project

General

Profile

Actions

Patch #22850

closed

Speedup remove_inherited_roles

Patch #22850: Speedup remove_inherited_roles

Added by Pavel Rosický over 10 years ago. Updated about 10 years ago.

Status:
Closed
Priority:
Normal
Category:
Performance
Target version:

Description

Environment:
  Redmine version                3.2.2.devel
  Ruby version                   2.1.5-p273 (2014-11-13) [x64-mingw32]
  Rails version                  4.2.6
  Environment                    production
  Database adapter               Mysql2
SCM:
  Git                            2.8.1
  Filesystem
Redmine plugins:
  no plugin installed

I made an optimalization to avoid these queries, that reliably kills the application if there are many member roles.

SELECT `member_roles`.* FROM `member_roles` WHERE `member_roles`.`inherited_from` = ?

This table was retrieved with a full table scan, which is often quite bad for performance, unless you only retrieve a few rows.
The table was retrieved with this index:
No index was used in this part of the query.
You can speed up this query by querying only fields that are within the index. Or you can create an index that includes every field in your query, including the primary key.
Approximately 1224500 rows of this table were scanned.


Files

patches.patch (1.54 KB) patches.patch Pavel Rosický, 2016-05-19 10:18
patches.patch (1.54 KB) patches.patch Pavel Rosický, 2016-05-25 18:19
patches.patch (1.54 KB) patches.patch speedup patch Pavel Rosický, 2016-05-25 18:21
patches20160525.patch (1.49 KB) patches20160525.patch speedup patch Pavel Rosický, 2016-05-25 18:23

Related issues 1 (0 open — 1 closed)

Related to Redmine - Defect #19179: Very slow performance on editing issues when projects have inherit members checkedClosedActions

Updated by Toshi MARUYAMA over 10 years ago Actions #4

  • Related to Defect #19179: Very slow performance on editing issues when projects have inherit members checked added

Updated by Toshi MARUYAMA over 10 years ago Actions #5

  • Description updated (diff)

Updated by Toshi MARUYAMA over 10 years ago Actions #6

  • Target version set to 3.4.0

LGTM.

Updated by Jean-Philippe Lang about 10 years ago Actions #7

  • Status changed from New to Closed
  • Assignee set to Jean-Philippe Lang

Patch committed, thanks.

Actions

Also available in: PDF Atom