Sometimes you need to iterate over a ton of items and you don't want the overhead of creating AR objects out of all of them. Hell, you only need a few things! Well, #pluck has your back.
But what if you want to iterate over many tonnes of items?
Pluck in batches to the rescue!
This isn't the exact code that I use in my code base, but it is damn close.
Enjoy!
and I made it work on any sortable, not just integer key: https://gist.github.com/ericcj/e58ae3b11ef14fc070862c8567cd1b7f