Database Administrator
Transactions and locking questions
122 questions on Transactions and locking for database administrators, easiest first.
Easy 36
- Durability in ACIDeasy
- Why a write-ahead log existseasy
- What ROLLBACK undoeseasy
- What C in ACID meanseasy
- What I in ACID meanseasy
- Statements without BEGINeasy
- What a phantom read iseasy
- PostgreSQL default isolationeasy
- Undoing part of a transactioneasy
- Locking a row you will changeeasy
- Not waiting for a locked roweasy
- Rolling back a CREATE TABLEeasy
- DDL in a MySQL transactioneasy
- Lock taken by a plain SELECTeasy
- Does VACUUM block the appeasy
- ACID vs eventual consistencyeasy
- Stopping negative wallet balanceseasy
- When others see your changeseasy
- Setting the level for one transactioneasy
- BEGIN inside a transactioneasy
- Guarding a reporting transactioneasy
- Two uncommitted writes to one roweasy
- Undoing a TRUNCATEeasy
- Trigger failure and the main writeeasy
- Why long transactions hurteasy
- Deleting 5 crore old rowseasy
- Insert or update in one statementeasy
- now() inside a long transactioneasy
- Client retries a payment requesteasy
- What a saga does on failureeasy
- When row locks are releasedeasy
- Holding a lock while the user decideseasy
- How committed work survives a crasheasy
- Open transaction during a crasheasy
- Lock wait vs deadlockeasy
- What optimistic locking meanseasy
Medium 48
- Non-repeatable readmedium
- Workers fighting over jobsmedium
- MySQL default isolation levelmedium
- A migration froze the whole appmedium
- Which levels allow which anomalymedium
- Read Uncommitted in PostgreSQLmedium
- Handling SQLSTATE 40001medium
- Two SELECTs, two answersmedium
- When the Repeatable Read snapshot startsmedium
- Could not serialize due to concurrent updatemedium
- UPDATE re-checks the WHERE clausemedium
- FOR SHARE vs FOR UPDATEmedium
- Flash sale stock without oversellingmedium
- Version check updates no rowsmedium
- Choosing optimistic or pessimistic lockingmedium
- Current transaction is abortedmedium
- MySQL keeps going after an errormedium
- Only one copy of a cron jobmedium
- App gets deadlock detectedmedium
- What deadlock_timeout controlsmedium
- MySQL lock wait timeout behaviourmedium
- Finding who blocks a sessionmedium
- Capping total transaction timemedium
- Check-then-insert creates duplicatesmedium
- Preventing overlapping room bookingsmedium
- Swapping two unique positionsmedium
- Counting page views in MySQLmedium
- Processing each message oncemedium
- Cache shows a rolled-back pricemedium
- Retry storms after deadlocksmedium
- Retried transaction sends two emailsmedium
- BEGIN and UPDATE on different connectionsmedium
- FOR UPDATE with GROUP BY failsmedium
- Table lock from UPDATEmedium
- Plain CREATE INDEX during trafficmedium
- Reading pg_locks for waitersmedium
- Logging long lock waitsmedium
- Several queries, one consistent picturemedium
- Taking a MySQL snapshot at startmedium
- LOCK TABLES in a transactionmedium
- Saga orchestration vs choreographymedium
- Why 2PC is avoided across servicesmedium
- Does PostgreSQL escalate row locksmedium
- Many commits, few disk flushesmedium
- Timestamp used as a version checkmedium
- RETURNING gives no row on conflictmedium
- Connections stuck idle in transactionmedium
- More serialization errors on long transactionsmedium
Hard 38
- Fixing a recurring deadlockhard
- InnoDB gap lockshard
- Two doctors go off callhard
- Locks held by nobodyhard
- Faster commits with a durability costhard
- Report total off by one transferhard
- Foreign key checks and row lockshard
- Advisory locks behind PgBouncerhard
- SELECT and SELECT FOR UPDATE disagreehard
- One UPDATE blocks the whole tablehard
- Long report under Serializablehard
- How PostgreSQL Serializable workshard
- Throughput of one hot counter rowhard
- Inserting 10,000 rows one commit eachhard
- Committed data lost after power cuthard
- Why fsync = off is dangeroushard
- Do SELECT-only transactions use XIDshard
- Two statements sent in one stringhard
- INSERT hangs on another sessionhard
- FOR UPDATE on a join locks too muchhard
- Poller misses some rowshard
- Connection drops during COMMIThard
- Many share locks on one rowhard
- Turning off InnoDB deadlock detectionhard
- MySQL Serializable and plain SELECThard
- Lowering MySQL isolation to cut lock waitshard
- An idle MySQL session blocks ALTERhard
- SELECT FOR UPDATE creates WALhard
- Queue length at a hot rowhard
- Guarding a rule across many rowshard
- Phantoms at PostgreSQL Repeatable Readhard
- Slowdown from a savepoint per rowhard
- Two locking options comparedhard
- How readers know a row committedhard
- Deadlock from two concurrent insertshard
- Serializable only on one sidehard
- REPLACE INTO removed child rowshard
- Locked rows come back out of orderhard