Question
EXPLAIN versus EXPLAIN ANALYZE: what does each show, and when should each be used?
Answer
EXPLAIN shows the planner’s estimated plan without executing it. EXPLAIN ANALYZE executes the statement and adds actual rows, loops, and timing. Use EXPLAIN for safe inspection; use ANALYZE on representative, controlled executions.