I'm a beginning programming using ActiveRecord outside of Rails to do
conditional processing of database records. So far, I've been
successful. However, my script loads all matching records into memory
first. There are hundreds of thousands of matching records so the
script quickly consumes over 500MB of RAM before any processing is
done. Is there a way to avoid this preloading of row objects in memory?
Below is an example of the type of thing I'm trying to do (although the
actual table row-level processing I'm doing is more complicated than
the example, but this isn't relevant to my question):
:adapter => "mysql",
:username => "root",
:password => "password",
:database => "my_schema"
class MyTable < ActiveRecord::Base
for m in MyTable.find(:all, :conditions => "some_column='criterion to
m.other_column = "new value"
#thanks for any tips