Skip to content
All terms
Postgres

MVCC (Multi-Version Concurrency Control)

Multi-Version Concurrency Control is Postgres's approach to concurrent reads and writes. Every row is a chain of versions; UPDATE writes a new version and marks the old one as "invisible after transaction X". Each running transaction sees a consistent snapshot of the database without locking out other sessions.

Benefits: readers don't block writers, writers don't block readers, strong consistency without coarse locking. Cost: old row versions accumulate as bloat until VACUUM (manual or autovacuum) reclaims them. A long-running transaction keeps old versions alive for the entire database, which is the source of most "why is this table 200 GB now" mysteries.

Read further