P
Sep 26, 2026PostgreSQL index bloat: why VACUUM never shrinks an index, and how to measure it with avg_leaf_density
A b-tree that has lost most of its keys keeps every page it allocated: PostgreSQL reclaims completely empty index pages, but a page with a few keys left on it stays put, and no autovacuum setting changes that. Measure the damage with pgstatindex.avg_
Sep 26, 202615 min read0 reactions0 comments