Parameter · Statistics / Cumulative Query and Index Statistics
track_cost_delay_timing
Collects timing statistics for cost-based vacuum delay.
- Default:
off - Type: bool
- Applies: Session (superuser)
In plain words
Vacuum deliberately sleeps now and then so it does not overload the disks (the cost-based delay). New in PostgreSQL 18, this setting records how much time it spent sleeping, so you can tell whether a slow vacuum is slow because of the throttle or because of real work.
For DBAs and operators
Shows up in:
pg_stat_progress_vacuum.delay_timeandpg_stat_progress_analyze.delay_time(ms, while it runs; for parallel vacuum it includes the workers)VACUUM (VERBOSE)/ANALYZE (VERBOSE)output: a linedelay time: 812.004 ms(absent when the setting is off)- autovacuum/autoanalyze log entries when log_autovacuum_min_duration fires
Captured on 18.6 (with vacuum_cost_delay = 1ms on a tiny table): the VERBOSE output gained delay time: 0.000 ms right before avg read rate.
How to use it: if a long-running autovacuum shows delay_time close to its total elapsed time, it is throttled; raise autovacuum_vacuum_cost_limit or lower autovacuum_vacuum_cost_delay. If delay_time is small, the vacuum is I/O- or CPU-bound and throttle tuning will not help. It reads the clock around each sleep, so check pg_test_timing on unusual platforms.
How to change it
A superuser (or a role granted SET) can change it per session with SET.
See it in context
VACUUM Autovacuum: when tables get vacuumed Cumulative statistics
Related parameters
vacuum_cost_delay autovacuum_vacuum_cost_delay autovacuum_vacuum_cost_limit log_autovacuum_min_duration track_io_timing