Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Mailing Lists -> Oracle-L -> RE: perl DBI question: fetchrow_array
I tried "fetch" (which is same as fetchrow_arrayref):
$dat->bind_columns(undef,\($row));
while($dat->fetch) {
print DATA "$row\n";
}
And it seems the performance improved a bit (about 5%). Using RowCacheSize or not does not seem to matter. The size of the table can vary from 1 row to 1 million rows. So I won't use fetchall_arrayref.
Thanks for your help.
Guang
> -----Original Message-----
> From: root_at_fatcity.com [mailto:root_at_fatcity.com]On Behalf Of
> Jared.Still_at_radisys.com
> Sent: Thursday, March 06, 2003 5:54 PM
> To: Multiple recipients of list ORACLE-L
> Subject: Re: perl DBI question: fetchrow_array
>
>
> 1) fetchrow_arrayref is faster than fetchrow_array, as Alex has noted.
>
> 2) I see you've already set RowCacheSize. Anecdotal evidence
> ( not just
> mine)
> suggests that the diminished returns obtained by setting this
> >100 aren't
> worth it.
>
> 3) try selectall_arrayref if you're data is not really
> large. 'really
> large' depends
> on your environment.
>
> 4) join DBI users list, found at lists.perl.org.
>
> Jared
>
>
>
>
>
>
> Alex <axs_at_m-net.arbornet.org>
> Sent by: root_at_fatcity.com
> 03/06/2003 01:34 PM
> Please respond to ORACLE-L
>
>
> To: Multiple recipients of list ORACLE-L
> <ORACLE-L_at_fatcity.com>
> cc:
> Subject: Re: perl DBI question: fetchrow_array
>
>
> try using fetchrow_arrayref and see if its faster or less resource
> intensive.
>
>
>
> On Thu, 6 Mar 2003, gmei wrote:
>
> > I have some perl code which selects table data and write it
> into a file.
> I
> > have something like:
> >
> > -------
> > $dbh->{RowCacheSize} = 10000;
> > open(DATA, ">$tn") || die "Can't open file\n";
> > $dat=$dbh->prepare("select
> id||chr(9)||FUNCTIONID||chr(9)||GENEID from
> > FUNCTION2GENE");
> > $dat->execute();
> > while(($row) = $dat->fetchrow_array) {
> > print DATA "$row\n";
> > }
> > close(DATA);
> > -----
> >
> > I am trying to see if there is any way to speed up the process.
> >
> > So here is my question:
> >
> > Is "fetchrow_array" the fatest way to get the data?
> >
> > TIA.
> >
> > Guang
> >
> >
> >
> > --
> > Please see the official ORACLE-L FAQ: http://www.orafaq.net
> > --
> > Author: gmei
> > INET: gmei_at_incyte.com
> >
> > Fat City Network Services -- 858-538-5051 http://www.fatcity.com
> > San Diego, California -- Mailing list and web
> hosting services
> >
> ---------------------------------------------------------------------
> > To REMOVE yourself from this mailing list, send an E-Mail message
> > to: ListGuru_at_fatcity.com (note EXACT spelling of 'ListGuru') and in
> > the message BODY, include a line containing: UNSUB ORACLE-L
> > (or the name of mailing list you want to be removed from). You may
> > also send the HELP command for other information (like subscribing).
> >
>
> --
> Please see the official ORACLE-L FAQ: http://www.orafaq.net
> --
> Author: Alex
> INET: axs_at_m-net.arbornet.org
>
> Fat City Network Services -- 858-538-5051 http://www.fatcity.com
> San Diego, California -- Mailing list and web hosting services
> ---------------------------------------------------------------------
> To REMOVE yourself from this mailing list, send an E-Mail message
> to: ListGuru_at_fatcity.com (note EXACT spelling of 'ListGuru') and in
> the message BODY, include a line containing: UNSUB ORACLE-L
> (or the name of mailing list you want to be removed from). You may
> also send the HELP command for other information (like subscribing).
>
>
>
>
> --
> Please see the official ORACLE-L FAQ: http://www.orafaq.net
> --
> Author:
> INET: Jared.Still_at_radisys.com
>
> Fat City Network Services -- 858-538-5051 http://www.fatcity.com
> San Diego, California -- Mailing list and web hosting services
> ---------------------------------------------------------------------
> To REMOVE yourself from this mailing list, send an E-Mail message
> to: ListGuru_at_fatcity.com (note EXACT spelling of 'ListGuru') and in
> the message BODY, include a line containing: UNSUB ORACLE-L
> (or the name of mailing list you want to be removed from). You may
> also send the HELP command for other information (like subscribing).
>
-- Please see the official ORACLE-L FAQ: http://www.orafaq.net -- Author: gmei INET: gmei_at_incyte.com Fat City Network Services -- 858-538-5051 http://www.fatcity.com San Diego, California -- Mailing list and web hosting services --------------------------------------------------------------------- To REMOVE yourself from this mailing list, send an E-Mail message to: ListGuru_at_fatcity.com (note EXACT spelling of 'ListGuru') and in the message BODY, include a line containing: UNSUB ORACLE-L (or the name of mailing list you want to be removed from). You may also send the HELP command for other information (like subscribing).Received on Fri Mar 07 2003 - 14:19:48 CST
![]() |
![]() |