MVCC¶
Multi-Version Concurrency Control enables concurrent reads and writes.
How MVCC Works¶
Each row has version metadata:
Visibility Rules¶
A row is visible to transaction T if:
created_txn < T(created before T started)deleted_txn IS NULL OR deleted_txn > T(not deleted before T)
Version Chain¶
Updates create new versions:
Garbage Collection¶
Old versions are cleaned up when no transaction needs them: