r/PHPhelp • u/Saitama2042 • Jul 24 '25
Need help to export large Data
Hi,
For one of our applications, we need to export large amounts of data from DB to a CSV file. About 2.5 M records in the DB table. At the csv file we need to dump 27 columns. We need to join about 7 tables.
We will use a job for exporting and after completion we shall send email notification to the user.
We are using Laravel 10 , my question is - can a CSV file hold 2.5M data? Even dump them, will the file be open able?
What will be the appropriate solution?
Thanks
6
Upvotes
View all comments
Show parent comment
3
u/Qualquer-Coisa-420 Jul 24 '25
I mean, can add LIMITs and OFFSETs to the queries and create multiple files
Or do some post processing on the file to break it into smaller files with split (bash)