Goal: observe a new automatic vacuum after tuning only this table.
Read global values and the fixture’s 20,000-row estimate. The dead-tuple threshold is base plus scale factor times estimated rows, capped by autovacuum_vacuum_max_threshold when enabled in PostgreSQL 19. With 50 and 0.2 the uncapped result is 4,050. Exceeding a threshold makes a table eligible; it does not guarantee an immediate worker. Setup analysed the table and temporarily disabled its vacuum so the stored baseline precedes this experiment. Insert-triggered vacuum is disabled only for this fixture to isolate the delete trigger.
All hints run at the Linux shell. psql -c executes quoted SQL and exits; each command uses a new connection. -U postgres explicitly selects the administrative SQL role, and -v ON_ERROR_STOP=1 stops on SQL errors. The monitoring tables are separate provided fixtures, not the baked business datasets.
Goal: apply a short launcher interval and verify the active value in a fresh connection.
ALTER SYSTEM writes a cluster-level override; pg_reload_conf() requests a reload. reload_requested=true means the signal was sent, so check SHOW separately. Five seconds helps observe this small lab; it is not a universal production recommendation or a promise to finish within one cycle. Worker availability and other databases affect scheduling.
Goal: make this fixture eligible at roughly 250 dead tuples.
Enable the table’s vacuum and set scale factor 0.01 and threshold 50. Storage parameters live in pg_class.reloptions, so this table change needs no configuration reload. Read the stored values: other tables keep their own/default settings. No manual VACUUM is used in this experiment.
Goal: produce more obsolete versions than the tuned threshold.
Delete 4,000 rows and verify 16,000 remain. Read the estimated dead count and automatic-vacuum count. Cleanup may already have started by inspection time; zero dead tuples can be a successful race, not proof the delete failed. The next step compares with the stored pre-experiment count and timestamp.
Goal: verify new worker activity instead of relying on an old timestamp or a fixed sleep.
The shell poll checks up to 60 times at one-second intervals, using fresh clients. It waits for autovacuum_count to exceed the saved baseline and for dead estimates to reach zero. break exits on success; the final query is the proof, even if the wait limit was reached. Expect new_auto_vacuum=true, has_auto_timestamp=true, and dead_cleared=true. This demonstrates one automatic pass, not a scheduling or performance guarantee.
Goal: confirm cleanup did not remove the per-table configuration or surviving data.
Read reloptions from a fresh connection and count the rows again. The table’s settings persist independently of any one client session. Their presence alone would not prove a worker ran; the previous step supplied that evidence.
Goal: remove the cluster-level observation shortcut after the experiment.
Reset the naptime override and reload, then verify the fresh connection is back at this image’s one-minute default. The demonstrated table override remains; a restart would not remove it. Production tuning balances workload, worker capacity, and I/O cost rather than choosing one interval for every installation.