Answer the question
In order to leave comments, you need to log in
How to iterate over a million records in a table?
The table has about a million entries. Foreychem I can sort out no more than 50 thousand. Memory is not enough. Increased to 7 gigs.
I did not find anything similar for the Laravel framework.
Asked a general topic Is there a limit for foreach?
But there advised PDO and fetch
Or memory to increase. I didn’t find anything like this in the Laravel docks, they advise through foraych.
Answer the question
In order to leave comments, you need to log in
https://laravel.com/docs/4.2/eloquent
_ docks are stupid: ctrl+F -> Chunking Results
There is a table with records about one million. I need to sort it out and weed it out in the process of sorting.
DB::table('users')->orderBy('id')->chunk(100, function($users) {
// Process the records...
return false;
});
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question