You might need to create an index for your query to avoid using the default
traversal indexer (that’s what the warnings are about). See Apache Oak
documentation on that. Also, rather than getting the entire result set for the
query at once consider pagination via setLimit and setOffset.
Aside from optimizing the query itself if it’s a large report, consider a
background sling job and only display pre-generated reports. If you are using a
product like Adobe AEM/CQ you can use CQ workflows as well. Of course I don’t
know if your use case allows this.
> On Sep 22, 2016, at 7:48 AM, Shurmer, Jordan <jshur...@scrippsnetworks.com>
> I'm wondering if I can get some opinions on the best way to find/filter nodes
> when there are tens of thousands of nodes in the tree. JCR Queries are simply
> timing out after some time, and sometimes generate a lot of log warning about
> node traversals (obviously). We usually end up writing our own simple node
> traversal script using the JCR Node api or the Sling Resource api. This still
> takes a really long time, and sometimes significantly affects the performance
> of the application
> Is there any other way of doing this sort of thing that we've overlooked?
> We're looking for an efficient method, which is consistent and reliable.
> Let me know what you all think!
> Jordan Shurmer | Software Engineer | Scripps Lifestyle Studios
> 9721 Sherrill Blvd, Knoxville TN 37932
> Office: 865-560-4887
> SCRIPPS NETWORKS INTERACTIVE | the Leader in Lifestyle Media |
> HGTV | Food Network | Travel Channel | DIY Network | Cooking Channel | Great
> American Country | TVN | Fine Living | Asian Food Channel