SQL2 search query taking too long to execute.
We have a pretty big repository and i'm trying to perform the following SQL2 query which takes around 30 seconds to execute.
Query -
SELECT * FROM [CUSTOMNODETYPE] as t where ISDESCENDANTNODE('path_under_required_folders') and t.isModified=CAST('true' AS BOOLEAN)I enabled the debug logs for the package org.apache.jackrabbit.core.query and am attaching the log messages..
Going through the logs the below message seems suspicious:
17.10.2014 01:43:18.049 *DEBUG* [10.239.60.171 [1413535373275] GET /crx/de/query.jsp?_dc=1413535372832&_charset_=utf-8&type=JCR-SQL2&stmt=SELECT%20*%20FROM%20CUSTOM_NODE_TYPE%20as%20t%20where%20ISDESCENDANTNODE(%27CUSTOM_PATH%27)%20and%20t.isModified%3DCAST(%27true%27%20AS%20BOOLEAN)&showResults=true HTTP/1.1] org.apache.jackrabbit.core.query.lucene.CachingIndexReader PlainDocId(2319940) not valid anymore.
I don't think that the search should be this slow. Just a FYI the query returns 57 search results in around 25 seconds.
Could anyone please help me understand why this is so slow? Is the indexing not happening properly?
Thanks