I hope someone can answer it.
I need to create a report that consist around 100k records in csv, excel, and pdf format.
I only have 4GB RAM, so far I can run the report that consist around 20k records. More than 20k the report goes memory exhaust.
My method is to query all the records and put it in an array and pass it to view and save it to csv/excel/pdf.
Which is not good way I think since your putting all the records in an array.
I was thinking about paginating the query in view upon saving it to csv/excel file. Let say 5k per query.
So is it possible do the query in view? Or there’s a better way to handle this situation?
I was using cakephp 3 by the way.