From: Steven R. <jun...@sh...> - 2003-07-30 20:21:20
|
Hi, I'm using DBI with MySQL, and am having a problem using the block version of select_all with a large table. If I do dbh.select_all('select * from small_table') do |row| p row end it works fine. If I do dbh.select_all('select * from big_table limit 10') do |row| p row end it works fine. If I do dbh.select_all('select * from big_table') do |row| p row end (where big_table is 25 gigs) it hangs without executing the block, and the mysqld server process pegs the CPU. I'm guessing that the block version of select_all is fetching the entire result set instead of fetching rows lazily (i.e., it's equivalent to dbh.select_all(...).each do |row|). Please tell me this isn't the case... thanks a lot, steven. |