Project

General

Profile

Actions

Feature #42681

closed

Avoid unnecessary SQL queries by reordering conditions in Gantt version subject rendering

Added by Go MAEDA 4 days ago. Updated 4 days ago.

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

0%

Estimated time:
Resolution:
Fixed

Description

Version#due_date is a simple attribute, while Version#start_date triggers a SQL query to calculate the minimum start date among related issues.

By reordering the condition to check due_date before start_date, unnecessary queries can be avoided and performance slightly improved when due_date is not set.

Example:

redmine-app(dev)> version.due_date
=> Sat, 01 Jul 2006
redmine-app(dev)> version.start_date
  Issue Minimum (0.1ms)  SELECT MIN("issues"."start_date") FROM "issues" WHERE "issues"."fixed_version_id" = ?  [["fixed_version_id", 1]]
=> Fri, 02 May 2025

Files

Actions

Also available in: Atom PDF