#34597: Queryset (split) exclude's usage of Exists is significantly slower than
subquery
-------------------------------------+-------------------------------------
Reporter: Lorand Varga | Owner: nobody
Type: | Status: new
Cleanup/optimization |
Component: Database layer | Version: 3.2
(models, ORM) |
Severity: Normal | Resolution:
Keywords: | Triage Stage:
| Unreviewed
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Comment (by Simon Charette):
Thanks for the investigation David!
The `AND "blog"."id" = "blog"."id"` is definitely something we want to
elide and was mentioned in comment:1 as a bug but the reporter said that
they were also getting poor results with the provided ORM examples that
explicitly don't have this criteria (e.g.
`~Exists(Blog.objects.filter(translation=None, id=OuterRef("id"))`) so I
suggest we wait to see how well the SQL examples (that don't have this
criteria) perform for the reporter.
In other words, the `AND "blog"."id" = "blog"."id"` part is definitely a
bug we want to solve but if we are going to address this issue it'd be
great to confirm it's the only factor to blame.
--
Ticket URL: <https://code.djangoproject.com/ticket/34597#comment:7>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
--
You received this message because you are subscribed to the Google Groups
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/django-updates/0107018867ab8a38-999b2679-1408-45ed-88d7-5c087a277f56-000000%40eu-central-1.amazonses.com.