The Query Eye
Perceptual training for database & query-plan review
Judge AI-written queries and index suggestions by reading the plan — seq scans, missing indexes, and full-table writes that pass review but melt under load.
Syllabus
Reading the Plan
How to read an EXPLAIN plan — and why a Seq Scan is not a verdict.
Indexes & Scans
When an index helps, when it can't, and when it's right to skip it.
Join Strategies
Nested Loop, Hash, Merge — and which one the data actually wants.
Cardinality & Stats
When the planner's row estimate is wrong, every choice after it is too.
Query Patterns & N+1
The bugs that live in the app code, not the plan: loops, fat selects, per-row subqueries.
Locking & Transactions
How a correct query becomes an outage by holding the wrong lock too long.
Pagination & Aggregation
Deep OFFSET, COUNT(*) badges, and sorts with nothing to sort on.
AI Query Failure Modes
When the AI's "optimization" is the bug — and when its alarm is a false alarm.