Hello everybody,
I am new with fuel, and to learn it, i decided to use it on one of our old customer project. But on this project, there's a user table, with something lke 80 fields ... for 40k record.
When i do a $data["liste"] = Model_Abonne::find('all'); (abonne is my user table), it's just hang my httpd, my browser, no error, cpu@100% forever.
Is there a way to avoid this ?
Thanks for your help (and your awesome framework)
No matter what you use, loading 40k records with 80 fields into memory is always a bad idea.
It should cause something to hang though, you should either run out of memory (if you haven't allocated enough) or out of time (if you have a slow system). Have you enabled all error reporting?
Also checkout your php.ini config, it should time-out after 30 seconds ('max_execution_time') or run out of memory ('memory_limit').
And if you do mean to work with these amounts of data, even though that's a very bad idea, you're probably better of using just the query builder (the DB classes) as it has less overhead.
But I'd just work in chuncks using offset & limit.
Thanks a lot for yours answers.
I know this kind of table are silly, but i herit from a old project, and are not allowed (for the moment) to change database structure.
Btw, i go i used query builder, and everything works fine and fast, thank you !
And for the php.ini things, i used to set them at a huge amount of ram and time (for batch test for example); i think it's why everything freeze, since the ORM try to load all in memory
Happy new year having fun with Fuel