Project

General

Profile

Actions

Feature #42077

closed

Optimize activity view performance through association preloading for journals

Added by Go MAEDA about 2 months ago. Updated about 1 month ago.

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

0%

Estimated time:
Resolution:
Fixed

Description

The current implementation of the Activity view triggers multiple SQL queries for each journal, which can lead to performance issues. The attached two patches mitigate the problem.

The first patch modifies the Journal#journalized method to use the preloaded Issue association if available. Currently, the journalized method executes redundant queries to fetch the associated Issue object, even when the Issue has already been preloaded.

The second patch updates the :scope parameter of acts_as_activity_provider to preload the tracker association through the related Issue, reducing queries against the trackers table when displaying each journal in the Activity view.

These changes reduce the number of SQL queries when displaying journals in the Activity view and can improve overall rendering performance.

Queries when rendering activities/index.html.erb:


Files

Actions #1

Updated by Go MAEDA about 1 month ago

  • Target version changed from Candidate for next minor release to 6.1.0

Setting the target version to 6.1.0.

Actions #2

Updated by Go MAEDA about 1 month ago

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

Committed the patches in r23446 and r23447.

Actions

Also available in: Atom PDF