Uploaded image for project: 'Jira Software Data Center'
  1. Jira Software Data Center
  2. JSWSERVER-16720

JQL using {not in} clause triggers a lucene search that makes the operation to take a long time

      Summary

      In a large Jira Software (Agile) instance (more than 4000000 issues) using the the not in clause to avoid querying one or a few projects among thousands will trigger a Lucene query that will search for an Agile custom field in openSprints() making the query to take a long time to complete.

      If the JQL is used as a filter in a board, it will cause the board to time out.

      Enabling DEBUG logging for Lucene queries will show a JQL similar to:

      {FIRST PART OF THE JQL} AND {project not in ("PROJECT NAME")} AND {status in (A VERY LONG LIST HERE)} AND ( {CUSTOM FIELD in openSprints()} OR NOT {SECOND PART OF THE JQL} order by Rank ASC
      

      Environment

      • Jira Software 7.2.13
      • Jira instance with a large number of issues and comments (more than 4000000 issues)

      Expected Results

      The JQL returns the results in an acceptable time not making boards to time out.

      Actual Results

      The JQL takes a long time and causes boards to time out.

      Workaround

      Avoid using the not in clause.

            [JSWSERVER-16720] JQL using {not in} clause triggers a lucene search that makes the operation to take a long time

            Esteban Casuscelli added a comment - - edited

            We determined this is not a bug as described in this previous comment.

            Esteban Casuscelli added a comment - - edited We determined this is not a bug as described in this previous comment .

            Esteban Casuscelli added a comment - - edited

            We have tried to reproduce this issue as well as to revisit the initial definition of the bug. We concluded that the bug is invalid as:

            • The not in clause is not the trigger point for building an inefficient JQL (lucene query) and the query was build as expected.
            • It is expected behaviour that the Agile plugin will add the clause sprint in opentSprints() to the Lucene query.
            • The main reason for this query to take a long time was the large data that it had to be processed in order to build the board.

            Based on the above, we have decided to change the status of this bug as invalid.

            Esteban Casuscelli added a comment - - edited We have tried to reproduce this issue as well as to revisit the initial definition of the bug. We concluded that the bug is invalid as: The not in clause is not the trigger point for building an inefficient JQL (lucene query) and the query was build as expected. It is expected behaviour that the Agile plugin will add the clause sprint in opentSprints() to the Lucene query. The main reason for this query to take a long time was the large data that it had to be processed in order to build the board. Based on the above, we have decided to change the status of this bug as invalid.

            Matt Doar added a comment -

            What is the "Agile custom field"? Another field referring to Sprint Ids?

            Matt Doar added a comment - What is the "Agile custom field"? Another field referring to Sprint Ids?

              Unassigned Unassigned
              ecasuscelli Esteban Casuscelli
              Affected customers:
              5 This affects my team
              Watchers:
              7 Start watching this issue

                Created:
                Updated:
                Resolved: