MVCC (Multi-Version Concurrency Control) คือวิธีที่ PostgreSQL จัดการการเข้าถึงแบบพร้อมกัน แทนที่จะ lock แถวสำหรับการอ่าน มันเก็บ หลายเวอร์ชัน ของแถว ดังนั้นแต่ละ transaction จึงเห็น snapshot ของข้อมูลที่สอดคล้องกัน ประโยชน์หลัก: ผู้อ่านไม่บล็อกผู้เขียน และผู้เขียนไม่บล็อกผู้อ่าน ทำให้มี concurrency สูง
แนวคิดหลัก: หลายเวอร์ชันของแถว
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.
