Configuration parameter

vacuum_cost_page_miss — PostgreSQL configuration parameter

Category Vacuuming Default 2

The estimated cost for vacuuming a buffer that has to be read from disk.

At a glance

Property Value
Parameter vacuum_cost_page_miss
Category Vacuuming
Default 2
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 for vacuuming a buffer that has to be read from disk. This represents the effort to lock the buffer pool, lookup the shared hash table, read the desired block in from the disk and scan its content. The default value is 2.

(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_miss; or SELECT name, setting, unit, context, source FROM pg_settings WHERE name = 'vacuum_cost_page_miss';.

Tuning guidance

Cost charged for a buffer miss during vacuum; tune the headline vacuum_cost_delay/vacuum_cost_limit first — the per-page costs rarely need adjusting.

Reference

PostgreSQL documentation — vacuum_cost_page_miss.

Keep going

Related & next steps

Concepts on this page

Was this helpful?

← All configuration parameters