jackrabbit-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Jukka Zitting" <jukka.zitt...@gmail.com>
Subject Re: Total size of a query result and setLimit()
Date Fri, 17 Aug 2007 23:16:25 GMT

On 8/17/07, Christoph Kiehl <christoph@sulu3000.de> wrote:
> Thomas Mueller wrote:
> > That's a good idea! Implementations that can't support it efficiently
> > could then calculate the size only when required. What about
> > getTotalSize()?
> Implementations should maybe even allowed to return -1 (as on
> RangeIterator.getSize()) if they do not support this method ...

I don't like the -1 result. As long as it's allowed, an interoperable
client must always assume that an implementation may return -1 and
provide a workaround for such cases.

How is the total size question typically solved in cases where an
application pages through a large database result set? I recall
sometimes using a separate COUNT(*) query for that, but there may be
more efficient alternatives.


Jukka Zitting

View raw message