Project

General

Profile

Actions

Patch #39835

closed

Optimize repository menu visibility check

Added by Go MAEDA 5 months ago. Updated 4 months ago.

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

0%

Estimated time:

Description

This patch introduces an optimization in the way Redmine determines the visibility of the "Repository" menu item.

While the current code loads the entire collection of repositories associated with the project, the new code only checks if there are any records in the repositories table associated with the project's ID. This can be faster if the project has a lot of repositories.

SQL of the current code:

 Repository Load (0.0ms)  SELECT "repositories".* FROM "repositories" WHERE "repositories"."project_id" = ?  [["project_id", 1]]

SQL of the new code:

  Repository Exists? (0.0ms)  SELECT 1 AS one FROM "repositories" WHERE "repositories"."project_id" = ? LIMIT ?  [["project_id", 1], ["LIMIT", 1]]


Files

optimize-repository-menu.patch (666 Bytes) optimize-repository-menu.patch Go MAEDA, 2023-12-12 15:19
Actions

Also available in: Atom PDF