PostgreSQL & Databases
Relational databases: tables, SQL and indexes
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.
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
- 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…
- Isolation levelsBeginner · 4 min
READ COMMITTED takes a fresh snapshot per statement; REPEATABLE READ retains a stable snapshot for the transaction.
- 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.