EXPLAIN ANALYZE
SQL command that shows the database's execution plan + actual runtimes per step. The standard tool for SQL performance debugging. EXPLAIN shows only the plan (free), ANALYZE actually runs the query + measures.
Columns to focus on: estimated vs actual rows (if the diff is 100x, the planner has guessed wrong — old statistics?), loops (nested loop with many outer rows = problem), Buffers (where data came from — disk vs shared_buffers). Tools: explain.depesz.com renders the plan with color coding. PostgreSQL: ANALYZE + BUFFERS + FORMAT JSON for full info. MySQL: EXPLAIN ANALYZE has existed since 8.0. Learning to read plans = half the DBA job.