Re: Partial aggregates pushdown

From: Bruce Momjian <bruce(at)momjian(dot)us>
To: "Fujii(dot)Yuki(at)df(dot)MitsubishiElectric(dot)co(dot)jp" <Fujii(dot)Yuki(at)df(dot)mitsubishielectric(dot)co(dot)jp>
Cc: Tomas Vondra <tomas(at)vondra(dot)me>, Jelte Fennema-Nio <postgres(at)jeltef(dot)nl>, PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>, Robert Haas <robertmhaas(at)gmail(dot)com>, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Stephen Frost <sfrost(at)snowman(dot)net>, Andres Freund <andres(at)anarazel(dot)de>, Tomas Vondra <tomas(dot)vondra(at)enterprisedb(dot)com>, Julien Rouhaud <rjuju123(at)gmail(dot)com>, Daniel Gustafsson <daniel(at)yesql(dot)se>, vignesh C <vignesh21(at)gmail(dot)com>, Alexander Pyhalov <a(dot)pyhalov(at)postgrespro(dot)ru>
Subject: Re: Partial aggregates pushdown
Date: 2025-03-29 22:22:53
Message-ID: Z-hyve2DLzBpdDdW@momjian.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Fri, Mar 28, 2025 at 02:00:44AM +0000, Fujii(dot)Yuki(at)df(dot)MitsubishiElectric(dot)co(dot)jp wrote:
> Hi Bruce, Jelte, hackers.
>
> I apologize for my late response.
>
> > From: Jelte Fennema-Nio <postgres(at)jeltef(dot)nl>
> > Sent: Thursday, August 8, 2024 8:49 PM
> > SUMMARY OF THREAD
> >
> > The design of patch 0001 is agreed upon by everyone on the thread (so far). This adds the PARTIAL_AGGREGATE label for
> > aggregates, which will cause the finalfunc not to run. It also starts using PARTIAL_AGGREGATE for pushdown of
> > aggregates in postgres_fdw. In 0001 PARTIAL_AGGREGATE is only supported for aggregates with a non-internal/pseudo
> > type as the stype.
> >
> > The design for patch 0002 is still under debate. This would expand on the functionality added by adding support for
> > PARTIAL_AGGREGATE for aggregates with an internal stype. This is done by returning a byte array containing the bytes
> > that the serialfunc of the aggregate returns.
> >
> > A competing proposal for 0002 is to instead change aggregates to not use an internal stype anymore, and create dedicated
> > types. The main downside here is that infunc and outfunc would need to be added for text serialization, in addition to the
> > binary serialization. An open question is: Can we change the requirements for CREATE TYPE, so that types can be created
> > without infunc and outfunc.
>
> I rebased the patch 0001 and add the documentation to it.

Okay, this is too late for PG 18 but I am hopeful we can make progress
on this for PG 19.

--
Bruce Momjian <bruce(at)momjian(dot)us> https://momjian.us
EDB https://enterprisedb.com

Do not let urgent matters crowd out time for investment in the future.

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Michael Zhilin 2025-03-29 22:57:28 [PATCH] Avoid useless prefetches in case of recent FPI WAL records
Previous Message Alexander Korotkov 2025-03-29 21:59:01 Re: Replace IN VALUES with ANY in WHERE clauses during optimization