General #

TOAST Storage The Oversized Attribute Storage #

CTEs #

e.g.

with materialized_set as (
    SELECT * FROM large_table
)
select * from materialized_set where materialized_set.id = 50

The above query would take much longer than

SELECT * FROM materialized_set mset where mset.id = 50

or even a subquery because the predicate (id = 50) can be “pushed down” and an index scan can be used to only find the row(s) with id = 50 instead of first scanning the whole table

Aggregations #

Database Size Managment #