On Fri, May 03, 2002 at 07:42:25AM -0700, Michael Peppler wrote:
> On Fri, 2002-05-03 at 05:53, Tim Bunce wrote:
> > On Fri, May 03, 2002 at 10:24:07AM +0100, Simon Oliver wrote:
> > > Tim Bunce wrote:
> > > > 
> > > > 4/ Add the ability to fetch a subset of rows in a single call.
> > > > I'm thinking in terms of adding a parameter to fetchall_arrayref
> > > > to request that only N rows be fetched.
> 
> > Secondly the attribute to specify the max rows can be specified as
> > being a hint that some old drivers might ignore. Same goes for
> > passing in the array ref to push rows onto.
> 
> FWIW DBD::Sybase has a syb_rowcount attribute that you can set to limit
> the number of rows that will be returned by a query (or that will limit
> the number of rows that will be *affected* by a DML statememt)

I think that won't be relevant here. The idea of changing
fetchall_arrayref to select N rows is to allow rows to be fetched
in 'batches' and thereby reduce the number of times you pay the DBI
call overhead. So the application will want to call fetchall_arrayref
again and again to get the next batches of rows.

It aims to fill the middle ground between using fetchrow_arrayref
to get each row in turn and using (the current) fetchall_arrayref
to fetch all the rows. The problem with the first is that you pay
the DBI call overhead on each row. The problem with the second is
that you may not have enough memory to hold all the returned rows.

Tim.

Reply via email to