Page Pruning

Created at: 2025-04-27

When a page is being read or updated, Postgres can perform some quick clean up on that page. Pruning happens when:

Page pruning will remove the tuples that cannot be visible any longer. That is, the tuples that are beyond the database horizon and therefore can't be seen by any transactions.

Pruning never goes beyond a single page, and thus can be carried through very fast. Pointers to pruned tuples remain in place, however, since they may be referenced by an index - which will be in a separated page.

Writes during reads

Since page pruning can happen during SELECT statements, these statements can modify data in the page.