PostgreSQL DBA

Query Performance & EXPLAIN

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.

This is 9 of 23 free samples for PostgreSQL DBA.

More PostgreSQL DBA topic samples