Skip to main content

MVCC, dead tuples, VACUUM and AUTOVACUUM

How does Postgres implement MVCC internally, why do UPDATEs create bloat, and what does VACUUM do?

Official Reference

Model Answer & Explanation

Every row version (tuple) stores xmin and xmax transaction IDs. UPDATE inserts a new tuple version and marks the old one with xmax; DELETE marks xmax without immediately reclaiming disk space. VACUUM marks dead tuples reusable (and freezes old xids to prevent wraparound), while long-running idle-in-transaction sessions block VACUUM from reclaiming dead rows.

Follow-up Interview Question · What is the difference between regular VACUUM and VACUUM FULL in terms of locks?

Module Context & References

PostgreSQL & Redis · Popular interview theory High-yield indexing, MVCC, query plan and Redis caching questions
Personal Notes · Markdown

Technologies & Interview Topics Covered

Switch between short-term interview tracks and long-term 80/20 engineering depth to practice JavaScript internals, React rendering and hooks, timed frontend machine coding UI challenges, MeetaPro FG300, Blind 75 & NeetCode 150 DSA patterns, Python & FastAPI APIs, PostgreSQL query optimization & MVCC, Redis caching, Applied AI RAG pipelines & evaluations, and distributed system design.