DB Internals AtlasPostgreSQL 18.6 Home About

Parameter · Vacuuming / Cost-Based Vacuum Delay

vacuum_cost_page_dirty

Vacuum cost for a page dirtied by vacuum.

  • Default: 20
  • Type: integer
  • Range: 0 … 10000
  • Applies: Session (any user)

In plain words

When VACUUM changes a page (removing dead rows, setting hint bits, freezing), that page must later be written to disk and WAL. That is the expensive part: 20 points by default.

For DBAs and operators

The dirty cost usually dominates the budget: with the defaults, autovacuum can dirty at most 200 / 20 = 10 pages per 2 ms nap, about 40 MB/s in total. Writes also produce WAL (and full-page images after each checkpoint), which is why throttling on dirtied pages is what protects replicas and the I/O system. Lowering this value speeds up vacuums that rewrite a lot (e.g. freezing a freshly loaded table) without making read-only passes faster.

How to change it

Any user can change it for their session with SET.

See it in context

VACUUM

Related parameters

vacuum_cost_limit vacuum_cost_page_hit vacuum_cost_page_miss autovacuum_vacuum_cost_limit

All Vacuuming parameters