1

When I perform a simple query like this:

select * from nodeType

Calling skip(N) on the range iterator is slow.

What am I doing wrong?

4

2 に答える 2

2

Found out why (self answering) - was using document order by default.

Try adding a sensible "order by" to the query - goes from minutes for 10000 nodes to < 1 second.

于 2009-02-22T22:00:36.403 に答える
1

Sadly, the RangeIterator skip() method in Jackrabbit implementation (RangeIterator is just an interface) is traversing over the nodes linearly. You might as well just write

int counter = 0;
while ( counter < offset && iter.hasNext() ) { iter.next(); counter++; }
于 2009-11-09T15:02:24.603 に答える