From: "James Britt (rubydev)" Date: 2001-12-08T03:07:33+09:00 Subject: [ruby-talk:27829] Re: DBI and large result sets Thanks to those who helped clarify things. Just to be sure I really do understand, suppose I have some code making a database connection to some remote machine. I have an SQL query I know will locate millions of rows. Running dbh.execute("SELECT * FROM MILLIONS_OF_EMPLOYEES") do |sth| sth.fetch do |row| p row end end means the local code only has a single row in memory at any given time. Using "fetch_all" in place of "fetch" means I have *all* of the rows in memory. Using fetch_many(n) means I have n rows in memory at any given time. (My apologies if I'm either stating, or missing something, obvious.) Thanks, James