1
1
Atlassian has announced a significant breakthrough in the performance and scalability of Jira Search, successfully addressing a critical bottleneck that affected its largest enterprise customers. As data volumes within Jira continue to expand, the engineering team faced the challenge of maintaining search responsiveness for organizations tracking millions of releases. For Atlassian’s most extensive deployments, this meant supporting nearly 6 million software release versions. At this unprecedented scale, the process of preparing search queries had become a primary performance bottleneck, with P99 query resolution times—the time it takes for the 99th percentile of queries to be processed—reaching as high as 18 seconds. Through a fundamental restructuring of how data is retrieved and processed, Atlassian has reduced this resolution time to just 92 milliseconds, representing a roughly 196-fold increase in speed.
The core of this improvement lies in the optimization of Jira Query Language (JQL), the specialized language users utilize to generate customized lists of work items, previously known as issues. JQL is the engine behind many of Jira’s most essential features, including charts, boards, and filters. Much like SQL is used for database management, JQL allows users and internal systems to fetch specific data points across a customer’s entire work item ecosystem. However, before a JQL query can be executed against a datastore, it must undergo a "resolution" phase. During resolution, human-readable names, such as project titles or usernames, and dynamic functions are replaced with their exact internal identification numbers (IDs). For instance, a query such as "project = ‘Test’ and assignee = currentUser()" must be transformed into a machine-ready format where the project name and the current user function are converted into specific unique identifiers before the search engine can fetch the matching results.
While resolving simple fields like project names or user IDs is computationally inexpensive, the resolution of version-related data presented a unique set of challenges. Teams use the "version" field to track software releases, and Jira provides several JQL functions to help automate version selection, such as earliestUnreleasedVersion() and latestReleasedVersion(). To resolve these functions, the search engine must evaluate the entire pool of versions associated with a customer, identify which ones meet the specific criteria—such as being unreleased—and then determine their chronological order to select the correct ID.

In the earlier stages of Jira’s development, the search engine relied on in-memory filtering to resolve these version functions. Because customers initially had a manageable number of versions, the system could fetch all available version data and store it in the application’s memory for processing. This approach was considered a well-balanced solution at a smaller scale, providing sufficient speed and simplicity. However, as Jira’s largest customers reached the milestone of 6 million versions, the legacy method of loading all data into memory became unsustainable.
The engineering team identified two primary ways in which this "load-everything" approach was damaging performance. First, the sheer volume of data being transferred and stored in memory led to significant latency. For a customer with 6 million versions, assuming each version record consumed approximately 500 bytes, the application would need to allocate roughly 3 GB of memory just to resolve a single function. Second, if a JQL query did not include a specific project filter, the function would attempt to return the earliest unreleased version for every project within the entire instance. For a large-scale enterprise, this meant a single function call could expand into a list of over 100,000 version IDs before the query even reached the datastore. In the most extreme cases, the slowest resolutions took nearly 30 seconds, creating a massive hurdle for user productivity.
To address this, Atlassian’s engineers analyzed query patterns and discovered that in more than 80% of instances, version functions were used in conjunction with a project clause. This insight led to the implementation of "Project Scoping." While a global enterprise might have millions of versions across its entire Jira instance, an individual project typically contains only a few hundred. By changing the JQL resolution logic to detect when a query is scoped to a specific project, the system now only retrieves versions relevant to that project. This shift drastically reduced the amount of data crossing the network. Instead of scanning millions of rows, the database now scans a few hundred. The impact on memory was equally dramatic: memory consumption for version data dropped from 3 GB for 6 million versions to a mere 250 KB for 500 versions. This optimization was the primary driver behind the reduction of P99 resolution times from 18 seconds to 92 milliseconds.
However, resolving queries that did not include a project filter—referred to as "unscoped" queries—remained a challenge. Without a project to narrow the search, the database latency on massive datasets often exceeded Atlassian’s timeout budgets. The engineering team investigated the behavior of their PostgreSQL database and found that as the number of version IDs in a JQL "IN" list grew into the tens of thousands, the Postgres query planner would stop using the primary key index. The database estimated that reading the entire table linearly (a sequential scan) would be cheaper than looking up each individual ID through the index. This resulted in significant slowdowns, as the benefits of indexing were lost exactly when they were needed most.

Atlassian considered several solutions, including passing IDs as a PostgreSQL array using "ANY" or "UNNEST" subqueries to keep the SQL compact. While these methods could avoid multiple round trips, they did not guarantee that the database would use an indexed lookup. After conducting scale tests, the team decided to implement a solution based on "parallel chunking." They replaced the single, massive data fetch with multiple smaller, chunked requests executed in parallel. By carefully selecting a batch size that was large enough to be efficient but small enough to ensure the Postgres query planner remained on the version_id index, the team was able to optimize the fetch process. This change reduced SQL fetch times for unscoped queries from over 30 seconds to under 700 milliseconds.
The success of these optimizations has provided Jira with the necessary headroom to continue growing alongside its largest customers without requiring immediate, radical architectural overhauls. Atlassian notes that these findings highlight a common issue in enterprise software development: a design that performs excellently for the average user can break down entirely at the extreme "long tail" of the distribution. Averages often mask these performance degradations, which is why the engineering team emphasizes the importance of instrumenting and studying real-world data usage patterns.
The fixes implemented for version resolution were not immediately obvious from the code alone; they required a deep dive into how data was shaped and how the database planned its execution. Atlassian views this as an ongoing process, noting that as customer data grows, queries that are efficient today will eventually require further refinement.
Looking toward the future, Atlassian is moving beyond these database-level fixes with the development of Jira Scalable Issue Search (JSIS). This initiative involves migrating JQL search functionality out of the primary Jira database and onto a dedicated search engine built on OpenSearch. As part of this transition, Atlassian plans to index version data directly within the search engine, ensuring that version information is co-located with the work items that reference them. This architectural shift is expected to provide even greater scalability and performance, ensuring that Jira can handle the next generation of enterprise data demands. By focusing on the long-tail performance metrics and continuously evolving its search infrastructure, Atlassian aims to maintain a consistent and responsive experience for all users, regardless of the scale of their operations.