On Mon, Nov 06, 2006 at 02:12:09PM +0100, Peter J. Holzer wrote:
> On 2006-11-06 11:58:44 -0000, [EMAIL PROTECTED] wrote:
> > I'm currently, for speed, using execute, bind_columns, fetch.
> > However, the number of columns I will be fetching is going to
> > increase. This is a pita for defining bind variables etc.
> > So, given that speed is paramount, should I continue with this
> > method or should I switch to fetch hashref?
>
> This is a question only you yourself answer.
>
> Rewrite your code to use hashref.
>
> *Measure* how much slower it is.
>
> Decide whether the performance is sufficient for your purposes.
Exactly. Also keep in mind the combined approach using bind_columns:
$sth->execute;
my %row;
$sth->bind_columns( \( @row{ @{$sth->{NAME_lc} } } ));
while ($sth->fetch) {
print "$row{region}: $row{sales}\n";
}
Tim.