Skip to main content
PreparationZone Logo
PreparationZone
Back to Fundamentals

Fundamentals · Hard · Free

What does EXPLAIN do? How read a simple query plan.

FresherFundamentalsDatabase Fundamentals
Model answer

EXPLAIN

sql
EXPLAIN ANALYZE
SELECT * FROM orders WHERE customer_id = 42;
  • Seq Scan vs Index Scan
  • Rows estimated vs actual
  • Look for nested loops on big tables
Run EXPLAIN on slow query before guessing indexes.