```
class Car << ActiveRecord::Base
end

Car.all.each do |car|
  # do stuff
end

```

This loads all the objects of type Car into memory (I think) and iterates through them. What I want instead is to iterate through all the ids and load them one at a time like this:

```
Car.all_ids.each do |id|
  c = Car.find id
  # do stuff
end

```

But all\_ids doesn't exist, is there an equivalent?