Re: Partial aggregates pushdown

From: Alexander Pyhalov <a(dot)pyhalov(at)postgrespro(dot)ru>
To: "Fujii(dot)Yuki(at)df(dot)MitsubishiElectric(dot)co(dot)jp" <Fujii(dot)Yuki(at)df(dot)mitsubishielectric(dot)co(dot)jp>
Cc: Bruce Momjian <bruce(at)momjian(dot)us>, PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>, Andres Freund <andres(at)anarazel(dot)de>, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Tomas Vondra <tomas(dot)vondra(at)enterprisedb(dot)com>, Julien Rouhaud <rjuju123(at)gmail(dot)com>, Daniel Gustafsson <daniel(at)yesql(dot)se>, Ilya Gladyshev <i(dot)gladyshev(at)postgrespro(dot)ru>
Subject: Re: Partial aggregates pushdown
Date: 2023-06-07 09:47:01
Message-ID: 36f0ba8bf12a7285ca6ff51559f700db@postgrespro.ru
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Fujii(dot)Yuki(at)df(dot)MitsubishiElectric(dot)co(dot)jp писал 2023-06-06 15:31:
> Thanks for the explanation.
> I understand that the method of comparing two function name strings is
> incorrect.
> Instead, I added the parameter isaggpartialfunc indicating whether the
> aggregate
> function and its aggpartialfunc are the same or different.

Hi.

This seems to be more robust, but the interface became more strange.
I'm not sure what to do with it. Some ideas I had to avoid introducing
this parameter. Not sure I like any of them.

1) You can use QualifiedNameGetCreationNamespace() for aggpartialfnName
and still compare namespace and function name for it and aggName,
aggNamespace.
Seems to be not ideal, but avoids introducing new parameters.

2) You can lookup for partial aggregate function after ProcedureCreate()
in AggregateCreate(), if it wasn't found at earlier stages. If it is the
aggregate itself - check it. If it's still not found, error out. Also
seems to be a bit ugly - you leave uncommitted garbage for vacuum in
catalogue.

Another issue - the patch misses recording dependency between
aggpartialfn and aggregate procedure.

--
Best regards,
Alexander Pyhalov,
Postgres Professional

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Drouvot, Bertrand 2023-06-07 10:19:31 Re: is pg_log_standby_snapshot() really needed?
Previous Message Daniel Gustafsson 2023-06-07 08:19:30 Re: Remove incidental md5() function uses from several tests