Project

General

Profile

Actions

Patch #43214

closed

Optimize Project.allowed_to_condition by replacing `projects.status <> ...` with `projects.status IN (...)`

Patch #43214: Optimize Project.allowed_to_condition by replacing `projects.status <> ...` with `projects.status IN (...)`

Added by Go MAEDA about 1 year ago. Updated about 1 year ago.

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

Description

The attached patch replaces the condition projects.status <> ... with the equivalent projects.status IN (...) in the Project.allowed_to_condition method.

This change makes the SQL clearer and may improve performance, since IN (...) is generally more optimizer-friendly than a combination of <> conditions. A performance benefit of this approach was also observed during the investigation of #40728 (see #40728#note-15 and #40728#note-16).


Files


Related issues 2 (0 open — 2 closed)

Related to Redmine - Feature #36691: Background job and dedicated status for project deletionClosedMarius BĂLTEANUActions
Related to Redmine - Defect #43651: Searching issues with searchable custom fields causes a performance regression on MySQLClosedGo MAEDAActions

Updated by Go MAEDA about 1 year ago Actions #1

  • Subject changed from Optimize Project.allowed_to_condition by `replacing projects.status <> ...` with `projects.status IN (...)` to Optimize Project.allowed_to_condition by replacing `projects.status <> ...` with `projects.status IN (...)`

Updated by Holger Just about 1 year ago Actions #2

Looks good to me, thanks!

Updated by Go MAEDA about 1 year ago Actions #3

  • Description updated (diff)
  • Target version set to 6.1.0

Updated by Go MAEDA about 1 year ago Actions #4

  • Related to Feature #36691: Background job and dedicated status for project deletion added

Updated by Go MAEDA about 1 year ago Actions #5

  • Status changed from New to Closed
  • Assignee set to Go MAEDA

Thank you for reviwing the change. I have committed the change in r23979.

Updated by Go MAEDA 11 months ago Actions #6

  • Related to Defect #43651: Searching issues with searchable custom fields causes a performance regression on MySQL added
Actions

Also available in: PDF Atom