EXPLAIN vs EXPLAIN ANALYZE

By Pradyumna Chippigiri

February 5, 2026


I ran into this while debugging a slow SQL query.


When debugging a slow query, we can use these two:


EXPLAIN query plan output

EXPLAIN ANALYZE query plan output

In general, explain analyze shouldn’t be run on data-modifying statements (create table, alter, update, insert, drop, delete, truncate) unless the intention is to modify data.


Also, if a query is extremely expensive, explain analyze can add unnecessary load because it’s a real run.


Best practice would. be to: