Re: Partial aggregates pushdown

Поиск
Список
Период
Сортировка
От Ashutosh Bapat
Тема Re: Partial aggregates pushdown
Дата
Msg-id CAExHW5s0EsBdQKGHxd9K4NjwbjawCa98x-Ejnu6EeZ_iAi9YYg@mail.gmail.com
обсуждение исходный текст
Ответ на Re: Partial aggregates pushdown  (Robert Haas <robertmhaas@gmail.com>)
Ответы Re: Partial aggregates pushdown  (Robert Haas <robertmhaas@gmail.com>)
Список pgsql-hackers
On Tue, Nov 28, 2023 at 5:21 AM Robert Haas <robertmhaas@gmail.com> wrote:
>
> TBH, I suspect even some PG forks have made this work, like maybe PGXC
> or PGXL, although I don't know for certain. We might not like the
> trade-offs they made to get there, but we haven't even talked through
> possible design ideas yet, so it seems way too early to give up.

If my memory serves me right, PGXC implemented partial aggregation
only when the output of partial aggregate was a SQL data type
(non-Internal, non-Unknown). But I may be wrong. But at that time,
JSONB wasn't there or wasn't that widespread.

Problem with Internal is it's just a binary string whose content can
change across version and which can be interpreted differently across
different versions. There is no metadata in it to know how to
interpret it. We can add that metadata to JSONB. The result of partial
aggregate can be sent as a JSONB. If the local server finds the JSONB
familiar it will construct the right partial aggregate value otherwise
it will throw an error. If there's a way to even avoid that error (by
looking at server version etc.) the error can be avoided too. But
JSONB leaves very very less chance that the value will be interpreted
wrong. Downside is we are tying PARTIAL's output to be JSONB thus
tying SQL syntax with a data type.

Does that look acceptable?

--
Best Wishes,
Ashutosh Bapat



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

Предыдущее
От: Ivan Trofimov
Дата:
Сообщение: Re: WIP: libpq: add a possibility to not send D(escribe) when executing a prepared statement
Следующее
От: Pavel Borisov
Дата:
Сообщение: Re: Table AM Interface Enhancements