examerioLogin
← Backend PythonQuestion 40 of 49

What is the difference between EXPLAIN and EXPLAIN ANALYZE in PostgreSQL?

📘 Explanation

EXPLAIN shows the planner's estimated plan without running the query, while EXPLAIN ANALYZE actually executes it and reports real timing and row counts—meaning data-modifying statements will really execute unless wrapped in a transaction you roll back. The other options incorrectly claim both run the query, that EXPLAIN ANALYZE just changes output format, or reverse which command actually executes.

📖 Learn: Indexes & query performance

Related questions

← PreviousNo login needed