Feature #42077
closedOptimize activity view performance through association preloading for journals
0%
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:
- log-without-patches.txt (the current implimentation)
- log-with-patches.txt (with the patches applied)
Files