Re: weird GROUPING SETS and ORDER BY behaviour

Поиск
Список
Период
Сортировка
От Geoff Winkless
Тема Re: weird GROUPING SETS and ORDER BY behaviour
Дата
Msg-id CAEzk6fcirmrAUBXE7cZNxdjuB3Ay8gEW=U9qeRntN0xBQq73rg@mail.gmail.com
обсуждение исходный текст
Ответ на Re: weird GROUPING SETS and ORDER BY behaviour  (Geoff Winkless <pgsqladmin@geoff.dj>)
Список pgsql-hackers
On Mon, 8 Jan 2024 at 11:12, Geoff Winkless <pgsqladmin@geoff.dj> wrote:
> What's even more of a head-scratcher is why fixing this this then
> breaks the _first_ group's ORDERing.

Ignore that. Finger slippage - looking back I realised I forgot the
"=0" test after the GROUPING() call.

It looks like I'm going to go with

ORDER BY GROUPING(test1.n), test1.n, GROUPING(CONCAT(....)), CONCAT(...)

because it's easier to build the query sequentially that way than
putting all the GROUPING tests into a single ORDER, and it does seem
to work OK.

Geoff



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

Предыдущее
От: John Naylor
Дата:
Сообщение: Re: [PoC] Improve dead tuple storage for lazy vacuum
Следующее
От: Aleksander Alekseev
Дата:
Сообщение: Re: Escape output of pg_amcheck test