----- Original Message -----
From: Leon Messerschmidt <[EMAIL PROTECTED]>
To: Turbine <[EMAIL PROTECTED]>
Sent: Friday, August 04, 2000 12:17 AM
Subject: Re: PROPOSAL: Limiting resultsets with Criteria and BasePeer
> Hi,
>
> Village has functionality of this sort already build into it (and I think
BasePeer
> also supports stuff like this). It selects a certain number of rows from
a
> specific offset. Can't we just add this capability to Criteria like this
>
> setOffset (int n)
> setNumRows (int n)
>
> Now we can just let it fall through and let Village handle the rest. I
suspect
> Village cycles through the resultset <NumRows> times. Because the actual
data is
> only transported once you ask for it this could give you the desired
effect, it
> think?
>
There is some functionality like this already in BasePeer and it is used in
LargeSelect to only grab a limited number of rows at a time. The
unfortunate thing is that how the result set might be handled by the driver.
It works great for limiting the display of results, but you can not depend
on it to, for example, grab only 100,000 of 10^9 possible rows because you
don't have the memory to store 10^9 records. Because the driver may go
ahead and grab all the rows into memory and hand them out a few at a time.
> Might be a little slower that using a native LIMIT statement, but we can
use it
> over *any* database that is currently supported.
>
> Any thoughts?
>
Take a look at what is in BasePeer and feel free to add the methods to
Criteria. I don't think it is a bad idea to add the supportsLimit type code
Nissam was suggesting earlier as it might be needed in some circumstances
where the above solution is not adequate.
John McNally
------------------------------------------------------------
To subscribe: [EMAIL PROTECTED]
To unsubscribe: [EMAIL PROTECTED]
Search: <http://www.mail-archive.com/turbine%40list.working-dogs.com/>
Problems?: [EMAIL PROTECTED]