-
Bug
-
Resolution: Fixed
-
High (View bug fix roadmap)
-
8.4.0, 8.5.11, 8.13.3, 8.15.0
-
8.04
-
2
-
Severity 3 - Minor
-
0
-
Issue Summary
A count of all archived issues in active projects is automatically run when loading the archived issue page even before a search is run. No issues, counts, or other information is displayed on the page when this query is executed.
Steps to Reproduce
- Enable SQL logging
- Load the Archived Issues page (secure/BrowseArchivedIssues!default.jspa)
- Check for count query in logs
- It's important to note that the count is cached(appears to be for 30 minutes). The query can be triggered again if you archive a new issue and then refresh the page
- No results or count are displayed on the page at this point
Expected Results
We'd expect that a query is not run until a search/filter is submitted. Depending on the filter, it may not be necessary to go through all active projects
Actual Results
A count of all archived issues is automatically run for every active project:
2020-09-16 16:15:19,075 http-nio-8851-exec-3 xxx 975x2634x1 pzyc10 /secure/BrowseArchivedIssues!default.jspa 22ms "SELECT COUNT(I.ID) FROM public.jiraissue I WHERE (I.PROJECT IN ('10001', '10000') ) AND (I.ARCHIVED = 'Y' )" 2020-09-16 16:15:19,076 http-nio-8851-exec-3 xxx 975x2634x1 pzyc10 /secure/BrowseArchivedIssues!default.jspa 0ms "SELECT COUNT(I.ID) FROM public.jiraissue I WHERE I.ARCHIVED='Y'"
In the test case there are only two active projects. In larger instances though, this will be a much larger query.
Because of this the Archived Issues page can take a long time to load in larger environments.
Workaround
Add the following index to Jira's database:
create index on jiraissue (project,archived)
This will increase the query speed time from minutes to seconds and allow the Archived Issues page to load quickly
This issue will be resolved in Jira 8.15.1, 8.16.0, and up.
I created an internal ticket for backporting the fix. Due to our policies on letting fixes soak for a moment before backporting them to LTS versions, I expect it will appear in Jira 8.13.7.