PostgreSQL & Databases
Isolation levels
READ COMMITTED takes a fresh snapshot per statement; REPEATABLE READ retains a stable snapshot for the transaction.
What is in the lesson
- A real situation where this goes wrong
- How it works, step by step
- A command to try yourself
- How it fails in production, and how to tell
- Three quiz questions with explanations
Read this lessonFree. No account needed.
More in PostgreSQL & Databases
- Relational databases: tables, SQL and indexesIntermediate · 5 min
Why the same query over 3 million rows takes 412 milliseconds and only 0.06 ms with one extra line, and the four ideas you need before anyone says RDS to you.
- Tuple visibilityBeginner · 4 min
PostgreSQL MVCC lets transactions see row versions according to snapshots and isolation semantics. Updates create new row versions; VACUUM eventually reclaims obsolete…
- Row locksBeginner · 4 min
UPDATE acquires row-level locks and concurrent writers can wait behind the transaction.
- DeadlocksBeginner · 4 min
PostgreSQL detects deadlock cycles and aborts one transaction to break the cycle.
- B-tree index selectivityBeginner · 4 min
The planner compares index access cost against a sequential scan using table statistics.
- EXPLAIN ANALYZEBeginner · 4 min
EXPLAIN (ANALYZE, BUFFERS) runs the query and reports actual plan timing and buffer usage.