You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@jackrabbit.apache.org by adampp <ad...@moesol.com> on 2007/03/15 05:52:21 UTC

Lazy Loading and RangeIterator Question

Does lazy loading of search result mean that when you jump around using the
RangeIterator's methods skip only the nodes that get touched by the iterator
actually get loaded?

That is, if I have 1 million nodes returned in a QueryResult and only want
to get records 50 through 59, then only those ten records actually get
loaded?

Thanks,  just want to get some architectural understanding before I write
some metrics.

Adam
-- 
View this message in context: http://www.nabble.com/Lazy-Loading-and-RangeIterator-Question-tf3406388.html#a9488604
Sent from the Jackrabbit - Users mailing list archive at Nabble.com.


Re: Lazy Loading and RangeIterator Question

Posted by Marcel Reutegger <ma...@gmx.net>.
Jukka Zitting wrote:
> On 3/15/07, adampp <ad...@moesol.com> wrote:
>> Does lazy loading of search result mean that when you jump around 
>> using the
>> RangeIterator's methods skip only the nodes that get touched by the 
>> iterator
>> actually get loaded?
>>
>> That is, if I have 1 million nodes returned in a QueryResult and only 
>> want
>> to get records 50 through 59, then only those ten records actually get
>> loaded?
> 
> No. The current lazy iterator always starts from the beginning, it's
> only the tail of the result set that is not loaded. In your case the
> iterator would load something like 60+ records, depending on the
> resultFetchSize setting in your SearchIndex configuration.

That's not quite correct. To be more precise it depends on what you mean with 
'record'? If you refer to a javax.jcr.Node instance or a jackrabbit NodeState, 
only the ones are loaded that you actually request through NodeIterator.next().

If you refer to an internal lucene document in the query handler, then Jukkas' 
statement is correct.

The lazy node iterator of the query result only check access rights for the 
nodes from the very beginning of the query result. however that does not require 
to actually load the node. access rights are checked using the NodeId.

regards
  marcel

Re: Lazy Loading and RangeIterator Question

Posted by Jukka Zitting <ju...@gmail.com>.
Hi,

On 3/15/07, adampp <ad...@moesol.com> wrote:
> Does lazy loading of search result mean that when you jump around using the
> RangeIterator's methods skip only the nodes that get touched by the iterator
> actually get loaded?
>
> That is, if I have 1 million nodes returned in a QueryResult and only want
> to get records 50 through 59, then only those ten records actually get
> loaded?

No. The current lazy iterator always starts from the beginning, it's
only the tail of the result set that is not loaded. In your case the
iterator would load something like 60+ records, depending on the
resultFetchSize setting in your SearchIndex configuration.

BR,

Jukka Zitting