Databases · Senior · Question 1 of 75
How does PostgreSQL decide whether a row version is visible to a transaction?
- ✓Correct answer: Each row version stores
xmin/xmaxtransaction IDs, which are compared with the transaction's snapshot - 2Visibility is decided by the order of rows on disk
- 3Each row has a boolean
visibleflag
Explanation
xmin is the creating transaction and xmax the deleting or updating one. A snapshot lists which transactions were still in progress, so the row is visible only if its creator committed before it.