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

SortableCustomField executes too many db queries

XMLWordPrintable

    • We collect Jira feedback from various sources, and we evaluate what we've collected when planning our product roadmap. To understand how this piece of feedback will be reviewed, see our Implementation of New Features Policy.

      Description

      There's a fallback implementation of ordering issues by custom field which can't be sorted using Lucene.

      This will cause n! executions of CustomField.getValue() which causes n! db queries for custom fields which are not loaded using EagerLoadingOfBizCustomFieldPersister (EagerLoadingOfBizCustomFieldPersister has some extra caching for CFs which store their values in customfieldvalues table)

      Reproduction scenario

      1. Create custom field which is not stored in customfieldvalue table.
        (I was using lexorank CF with disabled indexing)
      2. Create 25 issues
      3. Execute jql "ORDER BY <your custom field>"
      4. Measure, how many times ImmutableCustomField#getValue was called
        ER: 25 (one getValue() for each issue)
        AR: 125 (much more getValue() than needed)

      Proposed solution

      Reuse caching of custom field values inside IssueImpl and DocumentIssue

              izinoviev Ilya Zinoviev (Inactive)
              izinoviev Ilya Zinoviev (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

                Created:
                Updated:
                Resolved: