Partial Mode in Aggregate Functions

From: Marcos Pegoraro <marcos(at)f10(dot)com(dot)br>
To: PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Partial Mode in Aggregate Functions
Date: 2026-02-21 14:10:18
Message-ID: CAB-JLwaQSpjTNHtzMcaHw5yoKUi+tD444bT+OsbCYo3CBf=WLw@mail.gmail.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

My understanding reading [0] was that Partial Mode would be related to
FILTER (WHERE ...). And I'm not alone thinking that, see [1], Hans calls
Partial Aggregation.

Then I see that jsonb_agg does not have Partial Mode, but testing, it works
select jsonb_agg(V) filter (where V>1) from (Values(1),(2)) x(V)

Then reading more carefully on the header of this page says
Aggregate functions that support Partial Mode are eligible to participate
in various optimizations, such as parallel aggregation.

But what does Partial Mode mean to the user ? Is it related only to
parallel or any other optimization ? And all aggregate functions can have
FILTER ?
I'm not exactly sure how to explain this case better, but I think it needs
better wording.

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

[0] - https://www.postgresql.org/docs/current/functions-aggregate.html
[1] -
https://www.cybertec-postgresql.com/en/partial-aggregation-the-beautiful-way/
[2] - https://www.postgresql.org/docs/current/tutorial-agg.html

regards
Marcos

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Álvaro Herrera 2026-02-21 14:15:41 Re: generating function default settings from pg_proc.dat
Previous Message Álvaro Herrera 2026-02-21 13:49:58 Re: Incremental View Maintenance, take 2