in reply to Re: DBI Hash of Column name values
in thread DBI Hash of Column name values
Still slower than bind:
{ my $t0 = [ gettimeofday ]; my $n = 0; my $rows = $dbh->selectall_arrayref ($sql, { Slice => {} }); foreach my $row (@$rows) { $n++; } printf STDERR "slice: %9.2f recs/sec\n", $n / tv_interval ($t0); } { my $t0 = [ gettimeofday ]; my ($n, %rec) = (0); my $sth = $dbh->prepare ($sql); $sth->execute; $sth->bind_columns (\@rec{@{$sth->{NAME_lc}}}); while ($sth->fetch) { $n++; } printf STDERR "bind: %9.2f recs/sec\n", $n / tv_interval ($t0); } => with postgres on other server: slice: 23842.81 recs/sec bind: 27994.01 recs/sec with postgres on local server: slice: 214963.65 recs/sec bind: 505370.38 recs/sec
YMMV
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: DBI Hash of Column name values
by derby (Abbot) on Aug 10, 2010 at 12:37 UTC | |
by Tux (Canon) on Aug 10, 2010 at 13:52 UTC | |
|
Re^3: DBI Hash of Column name values
by avrono (Novice) on Aug 09, 2010 at 21:03 UTC |