Re: Partial Mode in Aggregate Functions - Mailing list pgsql-hackers

From Marcos Pegoraro
Subject Re: Partial Mode in Aggregate Functions
Date
Msg-id CAB-JLwa3qwxPbQ4V8wnnd4OVz2nTL=mGfrsK9C4X0ZnnC_uqmg@mail.gmail.com
Whole thread
In response to Re: Partial Mode in Aggregate Functions  ("David G. Johnston" <david.g.johnston@gmail.com>)
Responses Re: Partial Mode in Aggregate Functions
Re: Partial Mode in Aggregate Functions
List pgsql-hackers
Em dom., 1 de mar. de 2026 às 11:29, David G. Johnston <david.g.johnston@gmail.com> escreveu:
I can’t come up with a better header than Partial Mode. 

The problem is that if they conclude that there is no FILTER for that aggregate, 
they decide to run two queries, not the most readable or the most performant one.
with Data as (select V from MyTable where F1 = 100)
select (select jsonb_agg(V) from Data) Total,
       (select jsonb_agg(V) from MyTable where V>1) Filtered;

regards
Marcos

pgsql-hackers by date:

Previous
From: Daniil Davydov
Date:
Subject: Re: POC: Parallel processing of indexes in autovacuum
Next
From: Marcos Pegoraro
Date:
Subject: Re: Partial Mode in Aggregate Functions