Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:
I've a code reading a very big SQL result froma MySQL database:
my $query = $self->{dbh}->prepare("select * from $database.$self->{hit +_table} where time between ? and ? order by visit_id, time", {'mysql_ +use_result' => $self->{optimize}}); $query->execute($start_time + 0, $end_time + 0); while (my $row = $query->fetchrow_hashref()) { # Do calculation }
DBD::mysql::st fetchrow_hashref failed: Lost connection to MySQL serve +r during query
the query returns something like 10M of rows from a DB with more than 150M and it takes at least 1 hour.
My question is:
Which is the most performance methode to fetch so big results?
The difference between a fetchrow and a fetchall methode?
TIA
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: fetchrow and fetchall question
by matija (Priest) on Mar 17, 2004 at 12:19 UTC | |
|
Re: fetchrow and fetchall question
by UnderMine (Friar) on Mar 17, 2004 at 12:33 UTC | |
|
Re: fetchrow and fetchall question
by jeffa (Bishop) on Mar 17, 2004 at 14:05 UTC |