MVCC (Multi-Version Concurrency Control) وہ طریقہ ہے جو PostgreSQL بیک وقت رسائی کو سنبھالتا ہے — پڑھنے کے لیے rows کو lock کرنے کی بجائے، یہ متعدد ورژن rows کا رکھتا ہے، تاکہ ہر transaction ڈیٹا کا ایک مطابقت پذیر snapshot دیکھتا ہے۔ اہم فائدہ: readers writers کو block نہیں کرتے، اور writers readers کو block نہیں کرتے، جو زیادہ concurrency فراہم کرتا ہے۔
بنیادی خیال: متعدد row ورژن
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.
