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
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
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
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
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
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