MVCC(Multi-Version Concurrency Control、多版型同時実行制御)は、PostgreSQL が同時アクセスを処理する仕組みです。読み取りのために行をロックする代わりに、行の複数のバージョンを保持することで、各トランザクションがデータの一貫したスナップショットを見られるようにします。重要な利点は、読み取り側が書き込み側をブロックせず、書き込み側が読み取り側をブロックしないことであり、これにより高い同時実行性が実現されます。
中心となる考え方:行の複数バージョン
When a row is UPDATED, Postgres doesn't overwrite it — it creates a NEW version and
marks the old one obsolete. Different transactions can see different versions.
→ Each transaction sees a consistent SNAPSHOT of the database as of its start
(depending on isolation level), unaffected by others' uncommitted changes.
