Hi All,
We found the oak running into a problem consuming a lot of resources so we are trying to improve the XPath queries.
Our AEM is 6.0 on OAK 1.0.22. According to https://jackrabbit.apache.org/oak/docs/query/query-troubleshooting.html, queries should not traverse more than 1000 nodes. We start our AEM as:
java -server -Xms4096m -Xmx8192m -XX:MetaspaceSize=512m -XX:MaxMetaspaceSize=2048m -Doak.queryLimitReads=20000 -Doak.queryLimitInMemory=50000...
Test query:
/jcr:root/content/a/b//element(*,cq:PageContent)[@sling:resourceType='pages/my-resource' and (@cq:tags = 'custom-tag') ] order by @date descending
We index the field `date`, and there is only one article under /content/a/b, with resourceType 'pages/my-resource', cq:tags 'curstom-tag'. But we get the warning:
org.apache.jackrabbit.oak.query.FilterIterators The query read or traversed more than 20000 nodes.
java.lang.UnsupportedOperationException: The query read or traversed more than 20000 nodes.
And it returns nothing in the /crx/de/ Tools->Query tool.
If we get rid of the queryLimitReads and queryLimitInMemory in the startup script, we can get the article back.
Anyone has an idea why this happens? Thanks!
-kt