jackrabbit-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Alexander Klimetschek" <aklim...@day.com>
Subject Re: Contrasting performances of skip on node iterator
Date Thu, 02 Oct 2008 10:26:23 GMT
On Thu, Oct 2, 2008 at 12:17 PM, Sridhar Raman <sridhar.raman@gmail.com> wrote:
> I was testing a repository where a particular node has 10000 child nodes.
> If I get an iterator over these child nodes, and on this iterator, if I call
> a skip, the performance is very slow (almost 3 seconds for 9000 nodes).  On
> the other hand, if I were to run an XPATH query that returns the exact same
> 10000 nodes, and if I call on skip on this iterator, the skip is almost
> instantaneous.
> When I looked deeper, I noticed the iterator in the first case is a
> LazyItemIterator, while in the second case, it is a
> QueryResultImpl$LazyScoreNodeIterator.  Is that the only reason for the
> difference in performance?

>From the top of my head:

In the first case, the iterator looks at the real node data where it
has to deserialize the node bundle (which contains the links to the
child nodes) - there is simply no index involved here (that's the
reason for the current limitation of not using too many child nodes).

In the second case, the query index is used for the list of nodes,
which is faster.

Simply merging both solutions is not an easy option, since the query
manager is optional - if you turn of the search index configuration,
there won't be any index at all.


Alexander Klimetschek

View raw message