Changes between Initial Version and Version 1 of Ticket #23557, comment 8


Ignore:
Timestamp:
Aug 23, 2022, 11:51:04 PM (21 months ago)
Author:
Simon Charette

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #23557, comment 8

    initial v1  
    1 I'll note that the issue initially reported issue here is not reproducible anymore since #14357 which deprecated `Meta.ordering` from being considered when doing annotation. Even if that was not the case the optimization of selected primary key grouping in #19259 would also have solve the
     1I'll note that the issue initially reported issue here is not reproducible anymore since #14357 which deprecated `Meta.ordering` from being considered when doing annotation. Even if that was not the case the optimization of selected primary key grouping in #19259 would also have reduced the grouping to only `"cpu_job"."project_id"`.
    22
    33I still think that it would be worth to keep this ticket open though to go through a deprecation period and then raise an error when `values` is used for grouping and is paired with an explicit `order_by` that would result in extra `GROUP BY` entries. This can likely be achieved in [https://github.com/django/django/blob/897f38fabea5e1b196f11250ff6dadfffa489840/django/db/models/sql/compiler.py#L149-L154 SQLCompiler.get_group_by] by branching off `self.query.group_by is not True` and comparing the results of calling `self.collapse_group_by` with expressions originating from `order_by` and ones without and if there is any difference warn/raise.
Back to Top