Project

General

Profile

Actions

Patch #22850

closed

Speedup remove_inherited_roles

Added by Pavel Rosický almost 8 years ago. Updated over 7 years ago.

Status:
Closed
Priority:
Normal
Category:
Performance
Target version:
Start date:
Due date:
% Done:

0%

Estimated time:

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

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

Actions
Actions #4

Updated by Toshi MARUYAMA almost 8 years ago

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

Updated by Toshi MARUYAMA almost 8 years ago

  • Description updated (diff)
Actions #6

Updated by Toshi MARUYAMA almost 8 years ago

  • Target version set to 3.4.0

LGTM.

Actions #7

Updated by Jean-Philippe Lang over 7 years ago

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

Patch committed, thanks.

Actions

Also available in: Atom PDF