Hi @tushaar_srivastava ,
The query you're seeing:
SELECT * FROM [nt:base] WHERE [jcr:uuid] = $id OPTION(INDEX NAME [uuid], INDEX TAG [uuid])
is an out-of-the-box (OOB) query used internally by AEM and JCR (Jackrabbit Oak) for resolving nodes by UUID. Here’s a breakdown:
What this query does
- It fetches a node from the JCR repository using its UUID (jcr:uuid).
- nt:base is the base node type—so this query matches any node type.
- The OPTION(INDEX NAME [uuid], INDEX TAG [uuid]) hint tells Oak to use the uuid index, which improves performance when looking up nodes by UUID.
Why and where it is used
This is typically used in:
- References Resolution (e.g., from Reference or WeakReference properties).
- Replication or Version Restore operations.
- Permission Evaluation or Audit Tools.
- Admin search UIs or Sling ResourceResolver when a resource is accessed directly by UUID.
Action to take
No issue unless it shows abnormal usage or performance impact.
Check if:
- Custom components are trying to resolve by UUID excessively.
- Any workflow/process is looping over UUIDs.
- Use AEM's Query Performance Tool (http://localhost:4502/libs/granite/operations/content/diagnosistools/queryPerformance.html) to trace what is issuing the query, or enable debug logs for:
org.apache.jackrabbit.oak.query.QueryEngineImpl
org.apache.jackrabbit.oak.plugins.index
Regards,
Amit