Subject: Partial Mode in Aggregate Functions

From: "David G. Johnston" <[email-masked]>
Date: Sat, 21 Feb 2026 08:01:08 -0700

On Saturday, February 21, 2026, Marcos Pegoraro <[email-masked]> wrote:
>
>  Is it related only to parallel or any other optimization ?
>
>
Yes, see create aggregate for what is required when setting partial
aggregation to true.  The explanation on [0] (aggregate function reference
page) regarding why json creation functions show false is also informative.

>
> And all aggregate functions can have FILTER ?
>

Yes, the executor handles filter and simply omits invoking the aggregate if
the row does not pass the filter.  The aggregates have no awareness they
have been filtered.  Yes, one must reason their way to this, it isn’t
spelled out anywhere that I recall.

> I'm not exactly sure how to explain this case better, but I think it needs
> better wording.
>

I would agree.  Or a cross-reference at least.  It’s also another instance
of weasel-wording that seems to just invite doubt/questions.  But it does
say optimizations which means it does not affect the rows returned, which
filter does.

>
> Additionally, on this page there is no mention to FILTER (WHERE ...).
> Wouldn't it be better to explain something like it is on [2].
>

We already cross-reference to the authoritative sections for this.  Could
entertain a rephrasing of those cross-references but I would not go and
make a big thing of it here.  That said, maybe a separate “since all
aggregates accept a filter clause its syntax has been o tied here for
brevity” sentence would work and match up with the existing one for order
by.

David J.