I'm currently testing the performance of GraphQL queries in AEM. As part of the analysis using the Query Performance Analyzer, I'm attempting to capture the underlying JCR-SQL2 queries from the QueryStats section in the AEM System Console.
However, for some of the GraphQL queries I successfully execute, I’m unable to find any corresponding JCR-SQL2 entries in the QueryStats. Instead, I consistently see a single query (red-marked on the ss) that appears unrelated to the specific query being executed:
Can anyone help me understand why the actual JCR queries might not be showing up?
Is it possible that certain GraphQL queries are resolved without triggering JCR-SQL2 under the hood?
Any insights or guidance would be greatly appreciated — thank you in advance!
Views
Replies
Total Likes
Hi @JelenaS123,
I think, some GraphQL queries do not result in JCR-SQL2 executions, especially if the data is retrieved via direct resource access, in-memory resolution, or cached lookups rather than through the JCR query engine.
You can try these steps to verify whether JCR-SQL2 is used:
Temporarily disable caching (/system/console/configMgr/com.adobe.cq.graphql.persistentcache.impl.GraphqlCacheImpl)
Force a query-like condition, eg. a GraphQL query with a dynamic filter:
{
contentFragmentList(filter: {title: {_expressions: [{value: "Test", _operator: CONTAINS}]}}) {
items {
title
_path
}
}
}
These typically trigger JCR-SQL2 queries.
Enable DEBUG logging for:
Use Query Performance Analyzer to monitor runtime queries during GraphQL execution.
Views
Replies
Total Likes
@SantoshSai That makes sense, thank you for the explanation.
Since the methodology I previously used to test GraphQL endpoints relying on SQL2 isn’t applicable here, do you have any recommendations on how to analyze their performance?
I’m trying to determine whether optimization is needed, and if so, after applying changes, how to measure whether query performance has actually improved.
Views
Replies
Total Likes
Hi @JelenaS123,
Since not all GraphQL queries in AEM rely on JCR-SQL2, you can analyze performance by:
Disabling GraphQL caching temporarily via /system/console/configMgr/com.adobe.cq.graphql.persistentcache.impl.GraphqlCacheImpl to measure true response times.
Using tools like Postman, GraphQL Playground, or curl with timing enabled to compare response times before and after changes.
Enabling DEBUG logs for:
com.adobe.cq.graphql
com.adobe.cq.dam.cfm.impl.graphql
This helps detect backend resolution times.
Checking AEM system metrics (/status-heap, /status-slingthreads) for resource impact during query execution.
These steps should give you a good sense of whether optimizations are effective.
Views
Replies
Total Likes
@JelenaS123 If you talk about optimization , first thing you need to ensure is you should path based persistent queries instead of list based. You need to supply the fragment to the query via params then you will see very quick results but when you use List based queries then this will be the problem. Always use path based queries.
Views
Replies
Total Likes
Views
Likes
Replies
Views
Likes
Replies
Views
Likes
Replies