Closed half2me closed 4 years ago
@lindyhopchris could this be anything similar to the previous issue I had? (Linked above)
We're using Laravel Eloquent eager loading to include related resources, so not actually writing the SQL statements ourselves.
@lindyhopchris So I'm right in assuming these should be JOINs by default?
I'm not sure off the top of my head how they do it... you'll need to dig into the Laravel code to find out.
@lindyhopchris I realized after searching awhile that this is the way Laravel pulls in included relations. I'm coming from a cakePHP background, where JOINs are the default, hence my confusion.
No problem! Glad you found the answers you were looking for.
I hit my endpoint requesting some resources to be included. I would expect to have SQL JOINs to include those resources, but instead I'm getting a lot of queries, which doesn't scale very well, and also makes it impossible for me to filter based on a related resource. Here is a screenshot of an example request I send, and the queries it ends up generating.
Details of my adapters and validators are in this issue
In the documentation I read that it uses eager loading by default, so I don't understand why its doing it like this. Am I missing something?