Re: Querying vs iterating

2016-06-20 Thread Jason E Bailey
I have seen significant gains in obtaining a list of results, and the speed of my services, by doing an iteration versus a query. I have had a query looking for an indexed node type, going from 10 minutes to 1 and a half minute. I should point out that that makes no sense. When it was first

Re: Querying vs iterating

2016-06-20 Thread Julian Sedding
Hi Roy Yes, I would expect that you cannot measure any meaningful difference. Using a query may be marginally faster, because it can traverse using internal Oak APIs. On the other hand it may be slightly slower, because of possible QueryEngine overhead. Personally I would test whether it works

Re: Querying vs iterating

2016-06-20 Thread Roy Teeuwen
Hey Julian, Ok cool, for me the context is querying on a page in AEM, so I am creating a query for one cq:Page node, so that will be most of the times max like 10-20 nodes. So what you are saying then is that it shouldn’t really matter in performance to choose either for manually traverse

Re: Querying vs iterating

2016-06-20 Thread Julian Sedding
Hi Roy >From you question ("hard to put an index to it") I assume that you are running on an Oak repository. If that is incorrect, my answer does not apply. Oak will always consider traversal as an alternative to existing indexes. For most queries the cost of traversal is so high that an index

Re: Querying vs iterating

2016-06-16 Thread Steven Walters
Hopefully other people chime in here, I've only had bad experiences with utilizing queries and have often resulted in personally never using them - so I always end up iterating/navigating myself. Theoretically if you have a REALLY GOOD index then you may get some similar performances, but if your

Re: Querying vs iterating

2016-06-16 Thread Steven Walters
if you know there are that few resources, then I say iterating would be better performing than XPath / JCR-SQL2 queries. This is primarily from past experience speaking in that queries have generally turned out (often MUCH) slower than directly iterating if you know what you're actually looking