“Query Without Index Detected” alert for a custom Oak index in Adobe Experience Manager as a Cloud Service
This article explains how to resolve ‘Query Without Index Detected’ alerts in Adobe Experience Manager as a Cloud Service by validating and updating custom Oak index definitions to ensure queries use the intended index instead of falling back to traversal.
Description description
Environment
Adobe Experience Manager as a Cloud Service (all versions)
Issue/Symptoms
-
A custom SQL-2 query in AEM triggers a Query Without Index Detected alert during deployment of a new custom Oak index.
-
The query includes:
- Node type:
cq:Page - Path restriction under a specific content path, such as
/content/.../news - Filter:
jcr:content/cq:tags - Sort:
jcr:content/publishedDatein descending order - Explicit index tag:
customNewsLucene
- Node type:
-
The query resembles:
select [ jcr:path] , [ jcr:score] , * from [ cq:Page] as a
where [ jcr:content/cq:tags] = '/news'
order by [ jcr:content/publishedDate] desc
option(index tag [ customNewsLucene] )
- The alert indicates that no Oak/Lucene index can satisfy both the property restrictions and the sort order defined in the query.
- As a result, Oak falls back to traversal, which can negatively impact query performance.
Cause
The ‘Query Without Index Detected’ alert occurs when a query’s filter and sort conditions are not fully satisfied by any available Oak/Lucene index. This can happen if the custom index is not yet deployed, not fully available, or does not match the query’s requirements.
Resolution resolution
Follow the steps below to resolve the issue:
-
Open the AEM as a Cloud Service Developer Console and use the Query Performance Tool.
-
Run the affected query or select Explain to see which index is selected.
-
If the query doesn’t use the intended custom index or the plan shows traversal, review the custom index definition. Ensure that it supports the query’s requirements:
- Node type:
cq:Page - Property restriction:
jcr:content/cq:tags - Ordered property:
jcr:content/publishedDate, for descending sort - Path restriction: the relevant content path, such as
/content/.../news - Index tag:
customNewsLucene, matching the query’s explicit index tag
- Node type:
-
Deploy the updated index definition through Cloud Manager. Wait for the indexing update to complete before verifying the query.
-
Use the Query Performance Tool to confirm that the execution plan uses the intended custom index, handles the query restrictions and ordering, and doesn’t show traversal.
-
Optionally, monitor the query in Actions Center for a few days to check whether new Query Without Index Detected alerts appear for it.
-
For future index changes, validate them in a lower environment before production deployment. Use the Query Performance Tool’s Explain feature to confirm index selection.