-
-
Notifications
You must be signed in to change notification settings - Fork 6.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Eager loading doesn't work #3929
Comments
This is by design (eager loading in 2.0 is different from 1.1). |
This is a very unfortunate liability of using Yii2. Making 80% unnecessary database calls it totally unacceptable. This would only suffice for the simplest of database models. Any application that requires many table joins would severely suffer from this design flaw. Any application who uses a remote or external database connection, which is very common on apps hosted in the cloud, would suffer greatly as well. This would make an EAV database model totally out of the question. I have yet to encounter another framework that does not allow this functionality. The performance boost greatly outweighs the complexity. |
You may use following extension to get rid of redundant queries: |
I have sql query with eager loading
But it is doing 2 queries:
And then
Relation is
Is it a bug?
The text was updated successfully, but these errors were encountered: