retrieve many values

From: Ing. Branislav Gerzo (2ge_at_2ge.us)
Date: 02/22/05


Date: Tue, 22 Feb 2005 13:06:58 +0100
To: dbi-users@perl.org

Hi all,

I have table which consist of cca 20.000.000 rows, using MySQL.
How to do something with each row ? I mean: I can't select them
all into memory, I can't use LIMIT, because it is slow at higher
values, so what is good to use ?

I think about:
select id, name from table where id > 100

and after using
while(my $ha = $sth->fetchrow_hashref) {
         #do something with id,name
         #write to db new values...
}

but it is good way ? It will not consume memory ?

Please help me.