Investigating query which traverses 600k, think about adding index on the following criteria [nt:base] as [a] /* lucene:ntBaseLucene(/oak:index/ntBaseLucene) :ancestors:/content/dam/folder1/folder2 where ([a].[jcr:content/metadata/my_prop] in('value1, 'value2', 'value3')) and (isdescendantnode([a], ...