Materialized subqueries

This query includes a noncorrelated subquery that can be materialized:

select * 
from t1
where c11 = (select count(*) from t2)

The first step in the abstract plan materializes the scalar aggregate in the subquery. The second step uses the result to scan t1:


( sequence 
    (scalar_agg
        (i_scan i_c21 t2) 
    )
    (i_scan i_c11 t1)
)