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

This is a Pro chapter

Sign in, then upgrade to Pro or Power to unlock this and the full Databases Mastery library.

What is VACUUM in PostgreSQL and when should you run it?

Next Step

Continue to A high-traffic table is showing 40% bloat (dead tuples). Queries are getting slower. How do you fix it without downtime?← Back to all SQL questions