Professional Documents
Culture Documents
JQL Optimization
JQL Optimization
All JQL queries are not created equal. JQL uses a strict logic that will do exactly what you tell it to
do, whether or not it’s the most efficient way. These inefficiencies can add up, causing
performance issues in boards, plans, or projects.
On this page, we’ll talk about some general guidelines for writing an efficient JQL query.
Example
Let’s say that you want to view all the work assigned to you using a JQL filter. However, you only
work on two projects within your entire organization.
assignee is currentUser()
Why?
The first query searches through all of the issues in your site to find the ones assigned to you.
The second query is more focused on your projects. If your site has 10,000 issues Jira can look at
the 500 issues in those projects and can ignore the remaining 9,500. Fewer issues to sort
through, the quicker the query can run, even though the results are the same.
You can also use other fields to narrow the scope of your JQL query, such as dates, project type,
or last viewed.
Example
Say you use a JQL query to only show issues included in Project PMO or assigned to Assignee A
as well as those from Project TIS or assigned to Assignee B.
Why?
This is because when JQL contains an AND clause, Jira Software only returns issues that match
both sub-clauses not either/or, and would interpret the first query as:
Not only will the latter two searches not return any results, but Jira still runs the searches
regardless. These unneeded searches can slow down the performance of your JQL query. The
second query excludes the redundant searches, which can have a sizable impact on run times in
larger data sets.
The two fields and functions mentioned here are by no means an exhaustive list. You can
identify which fields and functions are causing delays in your query by building it clause by
clause instead of writing all of it at once. By gradually adding functions to your clause then
running your search, you can identify which fields are the slowest, and mitigate or avoid those
fields.