#33655: Unnecessary column in a GROUP BY clause with QuerySet.exists()
-------------------------------------+-------------------------------------
Reporter: Marc Perrin | Owner: Marc
Type: | Perrin
Cleanup/optimization | Status: assigned
Component: Database layer | Version: 4.0
(models, ORM) |
Severity: Normal | Resolution:
Keywords: exists group by | Triage Stage: Accepted
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Comment (by Marc Perrin):
Though after debugging this test, it might be a bit more complex than we
want/need (e.g. there are 4 fields in the GROUP BY anyway...) and I might
just add a new test e.g. "test_aggregation_annotation_exists" that gets
close to what I mentioned originally (e.g.
{{{
Book.objects.values('publisher').annotate(cnt=Count('isbn')).filter(cnt__gt=1).exists()
}}}
)
--
Ticket URL: <https://code.djangoproject.com/ticket/33655#comment:12>
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/0107018061f8dbb1-6cb7957b-93ad-4910-bff1-4ed53c748cd8-000000%40eu-central-1.amazonses.com.