vacuum: dead tuples and autovacuum
Check dead tuples, autovacuum thresholds, running vacuums, and global switches in the current database.
Inspects sys_stat_user_tables, pg_class.reloptions, sys_stat_progress_vacuum, and autovacuum switches in the current database. Read-only: never executes VACUUM.
Usage
Key Options
| Option | Effect |
|---|---|
--schema name | Limit tables to specific schema(s) (repeatable; conflicts with --all-schemas) |
--all-schemas | Include system schemas such as sysmac, sys_hm, kdb_schedule |
--limit N | Show at most N tables (default 20, 0 for unlimited; judges all tables in scope) |
--json | Emit structured JSON (vacuum.tables, vacuum.progress, vacuum.settings) |
Verdict & Reading Output
WARN(exit=1):vacuum.disabled(autovacuumortrack_countsis off) orvacuum.table_disabled(table exceededthreshold + scale_factor * reltupleswithautovacuum_enabled=off).UNKNOWN(exit=3):vacuum.settings/vacuum.progressfailed/skipped (including standby settings errors) ortrack_counts=offskipped table stats.OK(exit=0): switches are on and no disabled table exceeds threshold;due=yeswithautovacuum=onis normal queue behavior, not a fault. On standbys, table stats and running vacuums arenot_applicable.
Example (KES V9 Primary, COLUMNS=80)
Related Commands
kbdiag freeze— XID / multixact age and wraparound headroomkbdiag txn— oldest transaction holding back dead-tuple cleanupkbdiag slots— replication slots retaining oldxmin