VACUUM Is a Lie (About Your Indexes)

This title could be clearer and more informative.Try out Clickbait Shieldfor free (5 uses left this month).

PostgreSQL's VACUUM command effectively cleans dead tuples from table heaps but doesn't restructure B-tree indexes, leaving them bloated after large deletions. While VACUUM removes dead index entries and marks empty pages as reusable, it cannot merge sparse pages, reduce tree depth, or change the physical B-tree structure. This

13m read timeFrom boringsql.com
Post cover image
Table of contents
The anatomy of storageThe experimentUnderstanding page statesWhy the planner gets fooledThe hollow indexREINDEXpg_squeezeVACUUM FULL (The nuclear option)When to act, and when to chillConclusion

Sort: