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

      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

            [JRASERVER-71567] Archived Issues page automatically performs a count from all active projects

            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.

            Daniel Rauf added a comment - 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.

            Hi Matt, just in case you find it useful, we ended up creating an additional DB index to store "archived" flag in order to speed up the page load. That really helped but I totally agree this should be permanently fixed in the product.

            Kate Nevenchannaya added a comment - Hi Matt, just in case you find it useful, we ended up creating an additional DB index to store "archived" flag in order to speed up the page load. That really helped but I totally agree this should be permanently fixed in the product.

            Matt Doar added a comment -

            We're hoping this will get backported to 8.13 LTS

            Matt Doar added a comment - We're hoping this will get backported to 8.13 LTS

            Ability to archive issues in-app, is great! However, Archived Issues page is basically unusable because it takes 3 minutes to load. 
            Just like in JRASERVER-65602, a search should NOT run until a user asks for it. Thank you for considering!

            Kate Nevenchannaya added a comment - Ability to archive issues in-app, is great! However, Archived Issues page is basically unusable because it takes 3 minutes to load.  Just like in JRASERVER-65602 , a search should NOT run until a user asks for it. Thank you for considering!

              drauf Daniel Rauf
              34e46ad8c98b Branden Miars
              Affected customers:
              7 This affects my team
              Watchers:
              14 Start watching this issue

                Created:
                Updated:
                Resolved: