MVCC (Multi-Version Concurrency Control) — Concept Check
Questions on MVCC (Multi-Version Concurrency Control). InnoDB stores multiple row versions in the undo log; readers see a snapshot consistent with their transaction start, allowing readers and writers to proceed without blocking each other.
Questions in this quiz
8 questions on MVCC (Multi-Version Concurrency Control) — Concept Check. Work through them here, then start the quiz to answer them and see your score.
1.A transaction under REPEATABLE READ isolation level reads a row with a balance of $100. Another transaction updates the balance to $200 and commits. What balance will the first transaction see if it reads the row again?
- AAn error will occur
- B$200
- C$100
- DThe transaction will be blocked
2.A database shows a high 'History list length'. What is a likely cause?
- AFrequent reads causing undo log bloat
- BLong-running transactions holding old versions
- CHigh number of concurrent transactions
- DInsufficient disk space for undo logs
3.In the context of MVCC, what does the 'DB_ROLL_PTR' column in a row indicate?
- AThe transaction that last modified the row
- BA pointer to the undo log for the row
- CThe isolation level of the transaction
- DThe current version of the row
4.Under READ COMMITTED isolation level, a transaction reads a row's balance as $100, then reads it again after another transaction commits an update to $200. What balance will it see?
- A$100
- BThe transaction will be blocked
- CAn error will occur
- D$200
5.A transaction reads a row with a balance of $300. What happens if the transaction's read view is 'trx < 35'?
- AIt sees balance $200
- BIt cannot read the row
- CIt sees balance $100
- DIt sees balance $300
6.What is a common pitfall of MVCC in databases like InnoDB?
- AIncreased read latency due to write locks
- BFrequent deadlocks due to read locks
- CUndo log bloat from long transactions
- DInconsistent snapshots across transactions
7.A transaction reads a row with a balance of $200. What happens if the read view is 'trx < 45' and the row's 'DB_TRX_ID' is 50?
- AIt sees balance $200
- BIt cannot read the row
- CIt sees balance $300
- DIt sees balance $100
8.Why do reads never block writes in MVCC?
- ABecause writes are queued until reads complete
- BBecause reads use shared locks
- CBecause each transaction sees the latest committed data
- DBecause reads use snapshots of the database