dimanche 18 mars 2018

laravel performance difference just get vs select and get

I have a project(Laravel 5.4) where i need to improve performance as much as i can. So i was wondering what is the performance difference between:

$model->get()

get method takes all variables('created_at','updated_at', etc), so the select should be faster.

$model->select('many variables to select')->get();

select method is an additional query, so it takes more time, so maybe just get is faster?

I wanted to know if select and get is better in all occasions or are there any moments where just get is better?



from Newest questions tagged laravel-5 - Stack Overflow http://ift.tt/2IwR5S6
via IFTTT

Aucun commentaire:

Enregistrer un commentaire