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.
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.