#32006: Aggregation generates wrong SQL query on PostgreSQL partionned tables.
-------------------------------------+-------------------------------------
Reporter: Konstantin Popov | Owner: nobody
Type: Bug | Status: closed
Component: Database layer | Version: 3.1
(models, ORM) |
Severity: Normal | Resolution: wontfix
Keywords: QuerySet values | Triage Stage:
annotate GROUP BY | Unreviewed
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Simon Charette):
* resolution: invalid => wontfix
Comment:
> I have already discovered a number of side effects of this solution. Now
there is another one. It may be best to leave this ticket closed. Please
accept my apologies for the needless concern. I am ready to provide an
abbreviated version of my code here if anyone is interested
Thanks for the following report. The reason why I was asking what kind of
''table'' `rk7data_printcheck` was is that the ''group by selected table
primary key'' optimization is known to break for views, foreign tables,
and any other table-like objects that PostgreSQL cannot introspect enough
to determine this optimization is safe.
The optimization does make a huge difference when aggregating over tables
containing columns costly to join so we decided to keep it around even
with the aforementioned caveats. We did add a per-model hook to disable
though if that can be of any help to you #28107.
--
Ticket URL: <https://code.djangoproject.com/ticket/32006#comment:5>
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/067.23766aa779497dfa37bcf6247fd9ae12%40djangoproject.com.