I have huge db table, and i need to do something with here, but how i can do this?
if i write:
@person = Person.all
@person.each do |p|
//something
end
It’s loads, loads system, and took time. Are any ways to iterate for table by not loading all data to some variable?
This is a use case to use
find_in_batchesorfind_each.This will load data chunk by chunk, see doc.