Kozz has asked for the wisdom of the Perl Monks concerning the following question:
I need to write a perl script using the DBI module (mysql driver), and I will need to iterate over each and every record in a given table to perform some calculations. I though perhaps I should just go ahead and do something like
and then use $dbh->fetchrow_arrayref() to deal with each row of results at a time. However, there are thousands of records in the table right now, and when it's finally implemented, likely hundreds of thousands of records. Is this list of massive results stored in a temporary table someplace in the MySQL system, or is it stored in memory in the DBI object?SELECT * FROM tablename
My goal is to be able to do these iterations over each and every record, but I don't want the entire results to be shoved into memory, resulting in possibly consuming a vast majority of the system's overall memory. It's not important that this script run very fast, but I don't want it to slow the entire system to a crawl.
Again, forgive me, but I'm not sure if this is a perl question or database question. Probably both.
Humbly yours,
Kozz
|
---|
Replies are listed 'Best First'. | |
---|---|
Danger! Danger!
by perrin (Chancellor) on Oct 11, 2001 at 01:47 UTC | |
Re: Memory usage with DBI
by higle (Chaplain) on Oct 10, 2001 at 23:06 UTC | |
by seesik (Initiate) on Oct 10, 2001 at 23:21 UTC | |
Re: Memory usage with DBI
by CubicSpline (Friar) on Oct 10, 2001 at 23:24 UTC | |
by blakem (Monsignor) on Oct 10, 2001 at 23:50 UTC | |
Re: Memory usage with DBI
by guidomortonski (Sexton) on Oct 11, 2001 at 15:25 UTC | |
Re: Memory usage with DBI
by tadman (Prior) on Oct 11, 2001 at 19:01 UTC |