in reply to OT: MySQL and DBI efficiency question
If you're asking which one takes more memory, the answer is #2. DBD::mysql will fetch all of those rows into memory at once, even if your code is just iterating through them. The only way to avoid this is with the "mysql_use_result" option, which is documented in the DBD::mysql manual.