PostgreSQL Autovacuum Tuning: How to Check It Is Keeping Up
How to check if PostgreSQL autovacuum is keeping up, the SQL queries to run first, and per-table settings for busy tables. A practical DBA guide.
Read the articleNixsoft Monthly Newsletter · Issue No. 1

Welcome to the first Nixsoft Monthly Newsletter. Each month we will share what we have published, what we are seeing in client environments, and the open-source news worth your attention. This issue’s theme is a simple one: the fixes you have not applied and the backups you have not tested.
How to check if PostgreSQL autovacuum is keeping up, the SQL queries to run first, and per-table settings for busy tables. A practical DBA guide.
Read the articleThe most expensive problems in infrastructure are rarely exotic. They are the security update that sat in a queue for three months, and the backup that reported “success” every night but had never been restored. Neither shows up on a dashboard until the day it matters.
November was a good reminder. PostgreSQL shipped a release fixing 52 security vulnerabilities, and PostgreSQL 14 reached end of life with it. Teams with a tested patching routine will apply that in a maintenance window. Teams without one will discover how many servers they actually run.
Our advice for the new year is unglamorous: know every system you run, patch on a schedule rather than on a scare, and restore a backup at least once a quarter to prove it works. If you would like a second pair of eyes on any of that, we are happy to help.
Pravin Kore, Founder and Director, Nixsoft Technologies
The challenge. A high-volume financial-services client keeps ten years of historical records in a MySQL database of about 120 GB, so the data cannot be purged. Restoring it with the standard mysqldump and mysql tools took around six hours: one session, one table after another, indexes rebuilt as each table loaded. For a system that has to come back quickly after a failure, six hours was too long.
What we did. On a 76.7 GB test snapshot copy of the database, we timed the standard method against a parallel dump-and-restore script we built for the job:
The result.

What we learned.
Talk to us about your database recovery time
VulnGuard™ and the November PostgreSQL release. VulnGuard continuously scans hosts and container images for known CVEs and ranks each finding by its real-world risk. When a large security release like PostgreSQL’s lands, that means a prioritised list of which systems need the update first, instead of a spreadsheet hunt. It can raise tickets in Jira or ServiceNow and deploy patches automatically, and it runs as SaaS, self-hosted (including air-gapped) or as a hybrid agent.
You can see whether PostgreSQL’s autovacuum is keeping up with a single query. Tables with a large and growing n_dead_tup value are the ones to tune:
SELECT relname, n_dead_tup, last_autovacuum
FROM pg_stat_user_tables
ORDER BY n_dead_tup DESC
LIMIT 10;
For what to do next, see our autovacuum tuning guide.
The January issue will be out next month. To get it by email, sign up below. And if you would like a second pair of eyes on a restore or a patching plan, get in touch.
Once a month: our new articles, a client story, product news and open-source updates. Sign up and we'll email you each new issue.
One email a month, no spam. Unsubscribe any time by replying to any issue email. See our privacy policy.
Talk to our engineers, or browse what we do.