I need to pick a random record for a VERY large ActiveRecord set.
What's the best way to do this? I have something like this, but it still takes a long time.
Model.select('id').where("id = ? AND attr = ?", self.id, false).offset(rand(size)).limit(1)
Thank you