Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Some of our custom JQL functions take a subquery as a first parameter to narrow down the number of issues that will be checked (i.e. parentsOf(), linkedIssuesOf(), issuesInEpics(), …among others). You should enter terms here to restrict the number of issues the function will operate on. In additionNote that, our custom functions do not DO NOT filter these subqueries further to issues that have the relevant field(s) non-empty so you might also have these into account while crafting your JQL filters.

The overall performance of a query will be proportional to the number of issues that are returned by the subquery. This subquery argument can be matching anything from 0 to all issues of your instance which in huge instances could cause some performance issues or even take down your whole instance in the worst scenario.

Taking an example, if you are only interested in issues linked to unresolved Epics within the project EMEA you might go ahead and incorrectly type the following query:

Code Block
project = EMEA AND issue in issuesInEpics("resolution is not empty")

However although at first glance, this query might looks like trivial might it will cause serious performance problems on huge instances. Let’s dive deeper into it…

On the given example, provided subquery is "resolution is not empty" as you can see now, there is no project filtering in the subquery itself, project filtering take part in a later stage after issuesInEpics() function is executed. So under this scenario, subquery issuesInEpics() will try to search for any unresolved issue within the system regardless of the project as that’s what you asked the custom function to do. You might solve this problem by narrowing your subquery this way instead:

Code Block
issue in issuesInEpics("project = EMEA AND resolution is not empty")

This will effectively gather unresolved issues only from project EMEA as now that the project filtering take place within the function and not outside of it. This looks great

Our JQL filter now looks safer indeed, but as we stated at the very beginning of this page these kind of functions do not DO NOT filter by themselves the results to only issues that have the relevant field(s) non-empty. So forcing the subquery to explicitly only search for Epics within the will improve the overall performance and execution time even further. Kindly check Refers to the final query as the best performing oneshown below:

Code Block
issue in issuesInEpics("project = EMEA AND type=Epic AND resolution is not empty")

How

limit

to modify the number of results a subquery can

produce?

hit?
Status
colourGreen
titleSINCE V3.1.0

To protect your Jira instance from outages or extensive CPU or memory / RAM usage or simply stressing Jira Lucene index to much, our JQL sub-query based functions are (since v3.1.0) protected with a limitdefault guardrail. By default, this limit is configured to 50reject any subquery that hit more than 10,000 issues. However, we believe on freedom, so we leave the final decision to Jira administrators whether the limit should be increased or decreased as they know better than us their own set up.how much workload they can assume on the instances they administer. The subquery limit can be change by specifying a system property called jqlbooster.subquery.limit

(info) Note that on DataCenter Jira instances running multiple nodes at once, given system property needs to be added on every node present on the cluster.


For example, to decrease the limit to only 105,000 issues, you will need to configure a system property to the following value:

-Djqlbooster.subquery.limit=

10000

5000

For exact steps of how to set a system property on Jira instance please refer to official Atlassian documentation pages:

https://confluence.atlassian.com/adminjiraserver/setting-properties-and-options-on-startup-938847831.html

In the event someone runs a subquery that reaches the limit, the search won’t run and will throw the following error instead:

image-20240917-181040.pngImage Added

What JQL Functions are affected by these limits?

As for today the following JQL Functions will throw an error and reject to run within your instance if the underlying subquery produces more results than allowed on configured limit: