You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on May 26, 2023. It is now read-only.
I had User::all()->first() in some test code, and I was a bit surprised when it ran out of memory when run against the staging database. Looks like the generated sql is something like SELECT User.* FROM users as User, which creates an object for each row before selecting the first one.
Would anyone have an issue with a PR to make ::all()->first() work identical to ::all()->orderBy('primaryKey asc')->limit(1)?
Same applies to ::all()->last().
The text was updated successfully, but these errors were encountered:
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
I had
User::all()->first()
in some test code, and I was a bit surprised when it ran out of memory when run against the staging database. Looks like the generated sql is something likeSELECT User.* FROM users as User
, which creates an object for each row before selecting the first one.Would anyone have an issue with a PR to make
::all()->first()
work identical to::all()->orderBy('primaryKey asc')->limit(1)
?Same applies to
::all()->last()
.The text was updated successfully, but these errors were encountered: