MVCC & Distributed Tx

Preview — 3 of 10 questions

In PostgreSQL's MVCC implementation, what do the system columns xmin and xmax represent for a heap tuple?

javascript
-- Inspect MVCC system columns directly
SELECT xmin, xmax, ctid, * FROM orders WHERE id = 1;
Axmin is the row's creation timestamp; xmax is its deletion timestamp in Unix epoch format
Bxmin and xmax are lock identifiers used internally by the advisory lock subsystem
Cxmin is the minimum transaction ID in the current snapshot; xmax is the maximum transaction ID assigned so far
Dxmin is the transaction ID that inserted the row; xmax is the transaction ID that deleted or superseded the row (0 if the row is still current)

In PostgreSQLs snapshot isolation, what does a transactions snapshot actually capture?

AA full physical copy of all table data at the moment the transaction starts
BThe latest committed values for all rows in the database at snapshot creation time
CA lightweight structure containing: xmin (lowest active XID), xmax (next XID to be assigned), and a list of in-progress transaction IDs — used to determine row visibility without copying data
DThe list of all table-level and row-level locks held at snapshot creation time

What mechanism does PostgreSQL's Serializable Snapshot Isolation (SSI) use to detect dangerous concurrency anomalies?

AIt uses exclusive row-level locks to prevent all concurrent reads during a serializable transaction
BIt tracks read-write anti-dependency edges between concurrent transactions and aborts a transaction when a dangerous cycle is detected, indicating execution that cannot be explained by any serial order
CIt replays all committed serializable transactions serially after commit to verify correctness retrospectively
DIt uses a global lock table that serializes all SERIALIZABLE transactions through a single bottleneck

Sign up free to play

Answer all 10 questions (7 more), see explanations for every answer, and track your score.