Closed shineirvin closed 5 years ago
This is more of an ORM issue than a plugin issue. You should either refine your query and make it more specific, not necessarily faster though, or in case you need the whole table (hence calling ::all()
) I guess you could cache the result and read from cache. Whenever the users table or any other list you'd like to use gets updated also update the cached version.
\App\Person::all() is causing N+1 Query, How do I prevent it ?