I have a massive Foo table, from which I need to pull out all the values in a specific Foo.who field.
The array has millions of rows, but only a few thousand different values in the column who.
If the table were smaller, I would just use Foo.pluck(:who)
If I use Foo.find_in_batches do |a_batch|, each set is an array of Foo records, not a collection of activerecord records of Foo records, so I can't use .pluck()AFAIK either, the only way to extract a column whois through something like .map(&:who)that iterates through the array.
Is there a way to rip a column whoout of a Foo package in packages that do not require repeating over each element of each batch to retrieve the column who?
source
share