Hello,

As the DBD-Oracle documentation mentions us to "speak before you patch", I
would like to know if there are any objections to patching DBD-Oracle to
improve data fetch from REF CURSORs.

Prefetch does not work for REF CURSORs in OCI. Since this is the underlying
library for DBD-Oracle, fetching a large number of rows from a REF CURSOR is
very slow as a roundtrip to the DB is done for each row.  (See
http://www.cpanforum.com/posts/1567)

I would like to patch DBD-Oracle to allow faster retrieval of records from
REF CURSORs. I intend to do this by calling OCIStmtFetch to fetch more than
one row at a time (array fetch). I believe the improvements are significant.

I had discussed this with Mr. Tim Bunce quite a while ago and am listing the
last email for reference.

Thanks.

Biswa

>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>

On Fri, Jan 20, 2006 at 10:37:06AM -0500, Biswa Chowdhury wrote:
> -----Original Message-----
> From: Tim Bunce [mailto:[EMAIL PROTECTED]
> Sent: Friday, January 20, 2006 5:56 AM
> To: Biswa Chowdhury
> Cc: Tim Bunce
> Subject: Re: DBD-Oracle: implementing prefetch for REF CURSORs
>
> >But wouldn't any prefetch implemented outside if Oracles own libs will
> >require a round-trip to the server for each row, so you'll see little
> >gain over using $sth->fetchall_arrayref(undef, $max_rows)?
>
> No, if we implement prefetch, we will call to OCIStmtFetch in
> dbd_st_fetch (oci8.c)
> to return (say) 64 rows instead of 1 row.
> That lessens the roundtrips and speeds things up significantly.

Ah. I'd forgotten that OCIStmtFetch can take a count. Thanks.

Tim.

Reply via email to