Level 122
from collection or from database query?
If from collection then there is no performance gain if this is being used in blade
If from database then use ->select
MyView::where("foo", "bar")->select("col1", "col2", "col21", "col44")->get();
good morning ;)
What is the best way to select only certain columns of a large table from a performance perspective?
return MyView::where("foo", "bar")->get("col1", "col2", "col21", "col44");
or
return MyView::where("foo", "bar")->only("col1", "col2", "col21", "col44")->get();
or something else? and why?
Please or to participate in this conversation.