jackrabbit-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Thomas Mueller" <thomas.tom.muel...@gmail.com>
Subject Re: Total size of a query result and setLimit()
Date Fri, 17 Aug 2007 13:54:53 GMT

> retrieve the total result size

Google gives you only an approximation of the total result size.
Databases: if you don't want that the database engine reads the whole
result set, you need to run two queries (one to get the size).

> void setFetchSize(long size)

This would be a hint, and would not limit the number of rows the
application can read. This exists in the database world as well (as a

> as a replacement for setLimit()

I wouldn't remove setLimit(). Maybe Lucene does not have this option,
I don't know about that. But in the database world, it speeds up
queries. Sometimes the database can use a faster access method. When
ordering is used, Jackrabbit could simply ignore results that are (so
far) outside the limit, saving memory and speed up sorting.

setLimit() allows some optimizations (in JCR implementations) that are
not possible with setFetchSize().

If the application uses paging, it can and should use setOffset() and
setLimit() in my view.


View raw message