However in practice we need to perform certain task on each record and there are lots of records in the table. For this purpose we use batched queries in rails. Here is an example for the same:
###What is batched queries: Batched queries helps to select the records in batches. For example:
You can use select_in_batches also for the same purpose.
Thanks for the reading !!!