4 ms·
A simple example would be something like predicate pushdown: with mycte as ( select a, count(b) from foo group by a ) sel
by ibejoeb 7y ago
A simple example would be something like predicate pushdown:
with mycte as (
select a, count(b)
from foo
group by a
)
select *
from mycte
where a = 10;
There is enough information in the statement to plan it as
with mycte as (
select a, count(b)
from foo
where a = 10;
group by a
)
select *
from mycte;
Before, Postgres would have computed the aggregate for all values of `a`.