jeudi 29 juillet 2021

Processing code is slow when using group by in laravel?

I am processing in laravel, with product table has 300,000 items. In that table there are many duplicate names, so I used groupBy. But it takes a long time to process. Once I load the page and wait for it to finish processing the data, it also takes about 6 seconds to 7 seconds. Is there any way to optimize it fast,Thanks

$listProduct = Product::all()->groupBy('name'); // It takes about 6 seconds to 7 seconds to process this


from Newest questions tagged laravel-5 - Stack Overflow https://ift.tt/3l39onM
via IFTTT

Aucun commentaire:

Enregistrer un commentaire