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

searching issues via REST results in a high number of database queries

    XMLWordPrintable

Details

    Description

      NOTE: This bug report is for JIRA Server. Using JIRA Cloud? See the corresponding bug report.

      Problem

      A search via REST api call results in a high number of database queries, which could result in database performance issues.

      Testing:

      I ran a local test:

      • Enabled SQL Logging in JIRA
      • Ran search via issue navigator (HTTP)
        project = test
        
      • confirm SQL logging
      • Ran search via REST api
        curl -D- -u admin:admin -X GET -H "Content-Type: application/json" http://localhost:8079/rest/api/2/search?jql=project=test > restsearch-output
        

      Results:

      • both HTTP and REST searches returned 50 issues (there are a total 1201, but only 50 are shown at a time)
      • the 50 issues are all the same issue keys in both searchs
      • HTTP - 45 SQL queries
        • including checks/updates to userhistoryitem table, 12 queries
      • REST - 413 SQL queries
        • including auth for the user, 20 queries
        • did not seem to check/update userhistoryitem

      Edit:

      • Just ran same test with com.atlassian.jira.issue.search.providers set to DEBUG
        • HTTP - 5 lines of DEBUG logging
        • REST - 77 lines of DEBUG logging
          • There seems to be extra queries relating to parenttasks. I ran a quick check and there are 10 sub-tasks in the search results.
      • see attached file

      Attachments

        Issue Links

          Activity

            People

              ohernandez@atlassian.com Oswaldo Hernandez (Inactive)
              dchan David Chan
              Votes:
              17 Vote for this issue
              Watchers:
              24 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: