Project

General

Profile

Actions

Patch #40775

closed

Reduce an extra SQL query in IssuesController#retrieve_default_query

Added by Go MAEDA 7 months ago. Updated 7 months ago.

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

0%

Estimated time:

Description

The IssuesController#retrieve_default_query method to retrieve the default issue query checks if a query is explicitly specified in the session and the existence of the query.

Although the check for the existence is only necessary when session[:issue_query][:id] is set, the current code performs a query against the queries table even when session[:issue_query][:id] is nil. This causes an unnecessary query that checks if a row with id=NULL exists.

  IssueQuery Exists? (0.1ms)  SELECT 1 AS one FROM "queries" WHERE "queries"."type" = ? AND "queries"."id" IS NULL LIMIT ?  [["type", "IssueQuery"], ["LIMIT", 1]]

The attached patch changes to skip the unnecessary query when session[:issue_query][:id] is nil.


Files

Actions #1

Updated by Go MAEDA 7 months ago

  • Target version changed from Candidate for next major release to 6.0.0

Setting the target version to 6.0.0.

Actions #2

Updated by Go MAEDA 7 months ago

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

Committed the patch in r22854.

Actions

Also available in: Atom PDF