With large data set we can run into memory issue. Here is an example. 1 2>> Post.published.count 3=> 25000 4 5>> Post.where(published: true).each do |post| 6 post.archive! 7 end 8 9# Loads 25000 posts in memory 10 Copy Rails 5 adds warning when loading large data set To mitigate issue shown above Rails 5 has added config.active_record.warn_on_records_fetched_greater_than. When this configuration i
![Rails 5 Warning when fetching with Active Record](https://cdn-ak-scissors.b.st-hatena.com/image/square/df7dcf3e382d2d4b018ba79fc6642260e3fa7070/height=288;version=1;width=512/https%3A%2F%2Fres.cloudinary.com%2Fdpc4i4bdx%2Fimage%2Fupload%2Fbigbinary_blogs%2Fdefault_blog_image.png)