Re: Partial aggregates pushdown

From: Alexander Pyhalov <a(dot)pyhalov(at)postgrespro(dot)ru>
To: Peter Eisentraut <peter(dot)eisentraut(at)enterprisedb(dot)com>
Cc: Tomas Vondra <tomas(dot)vondra(at)enterprisedb(dot)com>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: Partial aggregates pushdown
Date: 2021-11-01 10:30:27
Message-ID: 4f0807de80eea5958febf96ace688c2d@postgrespro.ru
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Peter Eisentraut писал 2021-11-01 12:47:
> On 21.10.21 12:55, Alexander Pyhalov wrote:
>> Now aggregates with internal states can be pushed down, if they are
>> marked as pushdown safe (this flag is set to true for min/max/sum),
>> have internal states and associated converters. Converters are called
>> locally, they transform aggregate result to serialized internal
>> representation.
>> As converters don't have access to internal aggregate state, partial
>> aggregates like avg() are still not pushable.
>
> It seems to me that the system should be able to determine from the
> existing aggregate catalog entry whether an aggregate can be pushed
> down. For example, it could check aggtranstype != internal and
> similar. A separate boolean flag should not be necessary.

Hi.
I think we can't infer this property from existing flags. For example,
if I have avg() with bigint[] argtranstype, it doesn't mean we can push
down it. We couldn't also decide if partial aggregete is safe to push
down based on aggfinalfn presence (for example, it is defined for
sum(numeric), but we can push it down.

> Or if it
> is, the patch should provide some guidance about how an aggregate
> function author should set it.

Where should it be provided?

--
Best regards,
Alexander Pyhalov,
Postgres Professional

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Daniel Gustafsson 2021-11-01 10:51:30 Re: Missing include <openssl/x509.h> in be-secure-openssl.c?
Previous Message Amit Kapila 2021-11-01 10:28:20 Re: Added schema level support for publication.