Configuration parameter

vacuum_cost_limit — PostgreSQL configuration parameter

Category Vacuuming Default 200

This is the accumulated cost that will cause the vacuuming process to sleep for vacuum_cost_delay.

At a glance

Property Value
Parameter vacuum_cost_limit
Category Vacuuming
Default 200
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

This is the accumulated cost that will cause the vacuuming process to sleep for vacuum_cost_delay. The default is 200.

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

Tuning guidance

Raise it to let vacuum do more work between sleeps (faster, more I/O); the autovacuum equivalent is autovacuum_vacuum_cost_limit. Pair changes with vacuum_cost_delay.

Reference

PostgreSQL documentation — vacuum_cost_limit.

Keep going

Related & next steps

Was this helpful?

← All configuration parameters