-
Notifications
You must be signed in to change notification settings - Fork 343
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
Prevent extra sql queries from to-many and to-one ORM relations #634
Comments
You need to leftjoin (and to select). |
Thanks for the information @garak but if I'm not wrong when you use the |
My previous suggestion still stands |
Yeah, I already knew it, but when I start to do too much |
Anyway, you would get the very same problem with a normal list, without pagination. |
Hi!
I'm running
"knplabs/knp-paginator-bundle": "2.8.0"
pagination results in a list view. I'd like to know if it's possible to prevent run extra sql queries from to-many and to-one ORM relations. I've tried to->setHint(UsesPaginator::HINT_FETCH_JOIN_COLLECTION, false)
with no success. For example: I have a entityOrder
that hasone-to-one
relation withCart
. When I run my list with orders the classKnp\Component\Pager\Event\Subscriber\Paginate\Doctrine\ORM\QuerySubscriber\UsesPaginator
make a extra sql query for each relation ofOrder
. Is there a way to prevent this extra queries?The text was updated successfully, but these errors were encountered: