ARTIFACTORY: What can be done in case of slow AQL queries?

AuthorFullName__c
Elina Floim Alper
articleNumber
000005603
FirstPublishedDate
2023-03-06T12:32:23Z
lastModifiedDate
2025-07-20

ARTIFACTORY: What can be done in case of slow AQL queries?

The performance of AQL queries can be affected by various factors such as the complexity of the query, the number of the queried resource (repositories, builds), and the database performance. If an AQL query takes long to execute and is timing out, you may want to consider the following:

Increase the AQL query timeout:

By default, the AQL query timeout is set to 15 minutes. This timeout value is set to protect the system from any long-running queries that may affect performance. However, in some cases, this timeout value is simply too low and requires an increase. The timeout can be increased by adding the following system property to the $JFROG_HOME/artifactory/var/etc/artifactory/artifactory.system.properties file and stating the desired timeout. For example, this will increase the timeout to 45 minutes:
artifactory.aql.query.timeout.seconds=2700

A restart of Artifactory is required for the change to take effect. In the case of an HA setup, the value should be added to each of the nodes following a rolling restart. 
Note: This parameter is available from Artifactory version 7.41. Increasing the value may have an effect on performance and should be done with care.

Disable unique results:

AQL queries are translated to SQL queries behind the scenes. By default, AQL queries are executed with SELECT DISTINCT as the default value of distinct is true. This parameter enables/disables unique query results and is available from Artifactory version 7.37. This can be used to speed up the query or to get the results "as is". In order to set the distinct value of the query to ‘false’, the parameter should be added to the query itself. For example:
items.find({"name" : {"$match":"*.jar"}}).include("name").distinct(false)

In case the above suggestions do not improve the query’s performance, the slowness of the query may originate in the database. To validate the case, we recommend consulting with your organization’s DBA in order to inspect the query on the database side - reviewing the query execution plan, making sure that the indexes are valid, and looking into the fragmentation.