develooper Front page | | Postings from March 2001

Re: DBI 1.14 doc patches and performance tests

Thread Previous
Michael A. Chase
March 21, 2001 13:31
Re: DBI 1.14 doc patches and performance tests
Message ID:
The only surprise for me is that there wasn't more gain using
bind_columns()/fetch().  The documentation does mention it as faster than
the other methods and I never use anything else.  The aliasing of fetch()
from fetchrow_arrayref() isn't important, but using bind_col() or
bind_columns() is.

Maybe there is some way to emphasize it more strongly in the documentation.
A lot of people seen enamored with fetchrow_array() and fetchrow_hashref()
and may not realize the performance penalty they are incurring.


=item B<fetchrow_arrayref>

  $ary_ref = $sth->fetchrow_arrayref;
  $ary_ref = $sth->fetch;    # alias

Fetches the next row of data and returns a reference to an array
holding the field values.  Null field values are returned as undef.
This is the fastest way to fetch data, particularly if used with

Mac :})
** I normally forward private database questions to the DBI mail lists. **
Give a hobbit a fish and he'll eat fish for a day.
Give a hobbit a ring and he'll eat fish for an age.
----- Original Message -----
From: "H.Merijn Brand" <>
To: "Tim Bunce" <>
Cc: "DBI developers" <>
Sent: Wednesday, March 21, 2001 8:18 AM
Subject: DBI 1.14 doc patches and performance tests

> . . .
> Every percentage is the performance gain towards the previous (slower)
> method. What surprised my audience was the fact that using bind_columns
> fetch was faster along the line than fetch without bind_columns (everyone
> DBI in the audience seemed to use fetchrow_arrayref all the time, and they
> not aware of the fact that fetch was an alias. Noone was using
> . . .

Thread Previous Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About