PostgreSQL & Databases
MVCC visibility
PostgreSQL keeps several versions of a row, so readers and writers rarely block each other. You learn how a snapshot decides which version a query sees, and why old versions remain.
What you will be able to do
- Explain which row version a query sees, given its snapshot.
- Decide when a long transaction is costing table size, and what to check first.
What is in the lesson
- A real situation where this goes wrong
- How it works, step by step
- A walkthrough with commands you can run
- How it fails in production, and how to tell
- Three quiz questions with explanations
Read this lessonFree. No account needed.
More in PostgreSQL & Databases
- pg_stat_statementsBeginner · 4 min
The extension aggregates normalized query execution statistics across calls.
- Connection poolingIntermediate · 5 min
Why 800 mostly idle connections can take down a database that is doing almost nothing, and the one setting in PgBouncer that decides what your application can still do…
- Tuple versionsIntermediate · 4 min
A tuple is one stored row version, with xmin and xmax in its header. You learn why a deleted row still takes space, and why a normal vacuum rarely shrinks the file.
- Vacuum and autovacuumIntermediate · 4 min
PostgreSQL vacuum reclaims removable row versions and supports transaction-ID safety.
- Transaction ID wraparoundIntermediate · 4 min
Transaction IDs are 32 bits and wrap, so PostgreSQL freezes old rows with VACUUM. You learn how to read the age of each database and table, and what blocks freezing.
- Isolation anomaliesIntermediate · 4 min
An isolation level decides which concurrent changes a transaction can see, and which anomalies remain. You learn the four classic anomalies and how PostgreSQL's three…