beginnerPostgreSQL Specifics — MVCC, JSONB & VACUUM
What is VACUUM in PostgreSQL and when should you run it?
VACUUM removes dead row versions (dead tuples) created by PostgreSQL's MVCC. When you UPDATE or DELETE, old row versions are marked dead but not immediately removed. They accumulate as bloat, wasting disk space and slowing queries. VACUUM (regular): marks dead tuples as reusable, updates Free Space Map and Visibility Map. No exclusive lock. AUTOVACUUM: runs automatically based on n_dead_tup thresh
Ready to master this question?
Generate a complete walkthrough — background, the full answer in plain language, a working code example explained line by line, a real-world scenario, common mistakes, and how this same question gets asked in different ways.
Sign in to generate a response