Vacuum at the Page Level: Watching PostgreSQL Reclaim Space Byte by Byte
Vacuum at the Page Level

I dive deep into how PostgreSQL's VACUUM command actually works by inspecting database pages before and after cleanup. While simple pruning handles some dead tuples, I explain the complex three-phase process required when indexes are involved. You will see exactly how storage is reclaimed, why line pointers stay reserved temporarily, and how the system manages dead tuple IDs to prevent index bloat.
"Pruning cannot simply mark a deleted tuple's line pointer LP_UNUSED, because indexes still point at it by TID."