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

Issue Search has performance problems when sorting by custom field Labels

    XMLWordPrintable

Details

    Description

      The problem:

      The search issues functionality has performance issues when sorting by a custom field type Labels.

      Despite this field appears in the index, it takes much longer to return the result than sorting by other columns. This appears in atlassian-jira.log when profiling is enabled:

      2013-06-03 12:53:23,276 QuartzWorker-1 DEBUG ServiceRunner    com.atlassian.jira.plugin.ext.bamboo.service.PlanStatusUpdateServiceImpl:job [jira.web.filters.ThreadLocalQueryProfiler] 
      2013-06-03 12:53:23,277 QuartzWorker-1 DEBUG ServiceRunner    com.atlassian.jira.plugin.ext.bamboo.service.PlanStatusUpdateServiceImpl:job [jira.web.filters.ThreadLocalQueryProfiler] PROFILED : 17 keys (3 unique) took 1ms/5ms : 20.0% 0ms/query avg.
      [Unloading class sun.reflect.GeneratedMethodAccessor521]
      [Unloading class sun.reflect.GeneratedMethodAccessor429]
      [Unloading class sun.reflect.GeneratedMethodAccessor428]
      2013-06-03 12:54:01,619 http-bio-8090-exec-12 DEBUG admin 772x210x2 1b3uhe4 0:0:0:0:0:0:0:1%0 /rest/issueNav/1/issueTable/ [atlassian.util.profiling.UtilTimerStack] [64703ms] - Lucene Query
        [0ms] - IssueIndexManager.getIssueSearcher()
        [0ms] - PermissionManager.getProjectObjects()
        [0ms] - Collection.iterator()
        [0ms] - Iterator.hasNext()
        [0ms] - Iterator.next()
        [0ms] - Iterator.hasNext()
        [0ms] - PermissionManager.getProjectObjects()
        [0ms] - Collection.iterator()
        [0ms] - Iterator.hasNext()
        [0ms] - Iterator.next()
        [0ms] - Iterator.hasNext()
        [0ms] - Permission Query
          [0ms] - PermissionManager.getProjectObjects()
          [0ms] - Collection.iterator()
          [0ms] - Iterator.hasNext()
          [0ms] - Iterator.next()
          [0ms] - Iterator.hasNext()
          [0ms] - Collection.iterator()
          [0ms] - Iterator.hasNext()
          [0ms] - Iterator.next()
          [0ms] - Iterator.hasNext()
        [64702ms] - Lucene Search
      

      In some situation, it times out:

      2013-06-03 15:20:04,617 http-bio-8090-exec-4 ERROR admin 905x3431x5 tm9sjh 0:0:0:0:0:0:0:1%0 /rest/issueNav/1/issueTable/ [common.error.jersey.ThrowableExceptionMapper] Uncaught exception thrown by REST service
      com.atlassian.jira.exception.DataAccessException: org.ofbiz.core.entity.GenericDataSourceException: SQL Exception while executing the following:SELECT ID, FIELDID, ISSUE, LABEL FROM label WHERE FIELDID=? AND ISSUE=? (Query execution was interrupted)
      

      Also see atlassian-jira-gc.log for more information about garbage collection when this issue occurs.

      Steps to reproduce:

      1. Install Jira;
      2. Add a custom field type Labels;
      3. Generate some sample data (JIRA Data Generator plugin can help with that);
      4. Add values in this custom field in some issues;
      5. Navigate to search issues;
      6. Add the column of this custom field;
      7. Attempt to sort issue by this custom field.

      Attachments

        1. atlassian-jira-gc.log
          113 kB
        2. customfield.png
          customfield.png
          137 kB

        Issue Links

          Activity

            People

              Unassigned Unassigned
              tcomasseto Tiago Comasseto
              Votes:
              13 Vote for this issue
              Watchers:
              20 Start watching this issue

              Dates

                Created:
                Updated: