Configuration parameter

vacuum_cost_page_dirty — PostgreSQL configuration parameter

Category Vacuuming Default 20

The estimated cost charged when vacuum modifies a block that was previously clean.

At a glance

Property Value
Parameter vacuum_cost_page_dirty
Category Vacuuming
Default 20
Value type integer
Change scope Per-session (SET)
Available in PostgreSQL 12, 13, 14, 15, 16, 17, 18, 19 (added in 12)

What it does

The estimated cost charged when vacuum modifies a block that was previously clean. It represents the extra I/O required to flush the dirty block out to disk again. The default value is 20.

(Description quoted from the official PostgreSQL documentation.)

How to apply a change

Can be set per session with SET, per role/database with ALTER ROLE/DATABASE ... SET, or globally in postgresql.conf.

Inspect the current value and source with SHOW vacuum_cost_page_dirty; or SELECT name, setting, unit, context, source FROM pg_settings WHERE name = 'vacuum_cost_page_dirty';.

Tuning guidance

Part of the vacuum I/O cost accounting; raising it makes dirtying pages cost more so vacuum sleeps sooner on write-heavy passes. Most tuning happens via vacuum_cost_delay/limit instead.

Reference

PostgreSQL documentation — vacuum_cost_page_dirty.

Keep going

Related & next steps

Concepts on this page

Was this helpful?

← All configuration parameters