Re: GROUP BY ALL

Поиск
Список
Период
Сортировка
От Vik Fearing
Тема Re: GROUP BY ALL
Дата
Msg-id 86a93a08-8056-9c9c-7311-019b08458450@postgresfriends.org
обсуждение исходный текст
Ответ на GROUP BY ALL  (Andrey Borodin <amborodin86@gmail.com>)
Ответы Re: GROUP BY ALL  (Bruce Momjian <bruce@momjian.us>)
Список pgsql-hackers
On 12/19/22 05:19, Andrey Borodin wrote:
> Hi hackers!
> 
> I saw a thread in a social network[0] about GROUP BY ALL. The idea seems useful.
> I always was writing something like
>      select datname, usename, count(*) from pg_stat_activity group by 1,2;
> and then rewriting to
>      select datname, usename, query, count(*) from pg_stat_activity group by 1,2;
> and then "aaahhhh, add a number at the end".
> 
> With the proposed feature I can write just
>      select datname, usename, count(*) from pg_stat_activity group by all;


We already have GROUP BY ALL, but it doesn't do this.


> PFA very dummy implementation just for a discussion. I think we can
> add all non-aggregating targets.
> 
> What do you think?


I think this is a pretty terrible idea.  If we want that kind of 
behavior, we should just allow the GROUP BY to be omitted since without 
grouping sets, it is kind of redundant anyway.

I don't know what my opinion is on that.
-- 
Vik Fearing




В списке pgsql-hackers по дате отправления:

Предыдущее
От: Alvaro Herrera
Дата:
Сообщение: Re: pgsql: Doc: Explain about Column List feature.
Следующее
От: gkokolatos@pm.me
Дата:
Сообщение: Re: Add LZ4 compression in pg_dump