I think the change introduced this syntax
with history as materialized { .. }
so you have to declare the CTE as materialized to get this optimization
with history as materialized { .. }
so you have to declare the CTE as materialized to get this optimization
Not necessarily. You can get a materialized CTE if you request it regardless of its usage pattern, but you will also get one if the CTE is used more than once unless you suppress it.