Displaying 1 result from an estimated 1 matches for "weekly_deliver".
2011 Aug 25
3
ActiveRecord searching in batch (with find_by_sql)
I have an issue where I am getting a large number of records from the
database and I cant afford to keep it in the memory due to performance
issues.
Therefore using the following would be ideal,
User.find_each(:batch_size => 5000, :start => 2000) do |user|
NewsLetter.weekly_deliver(user)
end
however,
I would like to use find_by_sql since my query is user defined. Question
is, is it possible to use find_by_sql with batch_size and iterate
through all the record-sets?
Thanks
Bhavesh
--
Posted via http://www.ruby-forum.com/.
--
You received this message because you are sub...