Re: Missing Group Key in grouped aggregate
От | Tom Lane |
---|---|
Тема | Re: Missing Group Key in grouped aggregate |
Дата | |
Msg-id | 185735.1708444438@sss.pgh.pa.us обсуждение исходный текст |
Ответ на | Missing Group Key in grouped aggregate (Erik Nordström <erik@timescale.com>) |
Ответы |
Re: Missing Group Key in grouped aggregate
|
Список | pgsql-hackers |
=?UTF-8?Q?Erik_Nordstr=C3=B6m?= <erik@timescale.com> writes: > I noticed that, beginning with PG16, grouped aggregates are missing the > "Group Key" in the EXPLAIN output. > It seems the Agg node has numCols (number of grouping cols) set to zero in > queries like > SELECT foo, count(*) FROM bar WHERE foo=1 GROUP BY foo; > In PG15, the "Group Key" is shown and the Agg node has numCols set as > expected. Looks sane to me: the planner now notices that there can only be one group so it doesn't tell the GroupAgg node to worry about making groups. If it were missing in a case where there could be multiple output groups, yes that'd be a bug. If you want to run it to ground you could bisect to see where the behavior changed, but you'd probably just find it was intentional. regards, tom lane
В списке pgsql-hackers по дате отправления: