title: How to iterate over large number of records in MySQL with memory efficient manner in Spring Boot
body: <p>I want to fetch all records from a table using <code>findAll</code> and do some processing on each of them, but I'm not sure if it will give memory issues if the number of records is huge like in millions.</p>
  
  <p>I have looked into the <code>Pageable</code> but I'm not sure how to iterate over all the data using <code>Pageable</code> approach. Is it even possible to fetch few records at a time process them and fetch them again until all the records are processed? </p>
  
  <p>And what would be better? Fetch all the records in Iterable using <code>findAll()</code> method or the Pageable approach?</p>