#30158: Subquery expressions unnecessarily added to group by
-------------------------------------+-------------------------------------
Reporter: Jonny Fuller | Owner: Simon
Type: | Charette
Cleanup/optimization | Status: assigned
Component: Database layer | Version: master
(models, ORM) |
Severity: Normal | Resolution:
Keywords: subquery, group_by | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Simon Charette):
* needs_tests: 1 => 0
Comment:
Finally came up with an elegant solution. By changing
`Expression.get_group_by_cols`'s signature to accept an optional `alias`
parameter that is only provided when the annotated expression is being
explicitly grouped against. That allows `Subquery.get_group_by_cols` to
either return a reference to it's selected alias when grouped against or
no columns at all when it's not the case which is what this ticket is
tracking.
--
Ticket URL: <https://code.djangoproject.com/ticket/30158#comment:14>
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 post to this group, send email to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/django-updates/070.7007e8e0d0bdbb03330c678d52fb72a6%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.