pgstattuple — Bloat Metrics
Install pgstattuple to light up table/index bloat percentages on the Tables and Indexes pages.
pgstattuple is the cheapest measurable upgrade you can give MonPG. Five seconds to install. No SPL, no restart. Reversible. And without it, our bloat columns are estimates, not measurements.
What it unlocks
With pgstattuple installed, MonPG calls pgstattuple(table) and pgstatindex(index) on each relation periodically. The output: real dead-tuple percentages, real free-space percentages, real index leaf-page density. The Tables page sorts a "bloat %" column descending — your worst tables to the top. Same on the Indexes page. VACUUM Advisor reads from the same path and stops needing to estimate from pg_stat_user_tables heuristics.
Without it, we estimate. The estimates are roughly right most of the time. They miss high-churn tables that have constant insert/delete cycles where pg_stats can't keep up. Real pgstattuple output catches those.
Installing
On most managed PG, plain CREATE EXTENSION pgstattuple; works. RDS, Cloud SQL, Crunchy, Aiven, self-hosted — all ship it. Azure Flex requires you to add pgstattuple to the azure.extensions server parameter first, then create the extension. Heroku ships it on Standard tier and up; not available on Hobby.
If you ticked the pgstattuple box during MonPG's onboarding, we ran the CREATE EXTENSION for you on every monitored database. You can verify with:
SELECT * FROM pg_extension WHERE extname = 'pgstattuple';
Cost
This is the one fair question to ask before installing. pgstattuple reads every tuple in a table to compute exact bloat. On a one-million-row table that's fine; on a one-billion-row table that's an I/O storm. MonPG paces these calls — we run them once per twenty collection cycles, which works out to roughly once every ten minutes per relation, and we use pgstatindex for indexes (cheaper than full pgstattuple).
For most workloads under one terabyte total, the impact is unmeasurable. Above that, watch the System page's I/O timing for a couple of cycles after install. If you see a noticeable bump, you can disable per-table sampling for the worst offenders via Settings → Servers → Sampling. Or contact support — we can switch you to a sample-based approach instead of full-tuple scan.