Uploaded image for project: 'Jira Data Center'
  1. Jira Data Center
  2. JRASERVER-71567

Archived Issues page automatically performs a count from all active projects

    XMLWordPrintable

Details

    Description

      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

      1. Enable SQL logging
      2. Load the Archived Issues page (secure/BrowseArchivedIssues!default.jspa)
      3. Check for count query in logs
      4. 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
      5. 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

      Attachments

        Issue Links

          Activity

            People

              drauf Daniel Rauf
              34e46ad8c98b Branden Miars
              Votes:
              7 Vote for this issue
              Watchers:
              14 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: