Show the planner's chosen execution plan.
Section: EXPLAIN and Plan Analysis
EXPLAIN query
sql
sql
EXPLAIN SELECT * FROM orders WHERE customer_id = 42;Explanation
See summary for usage details.
Learn the surrounding workflow
Compare similar commands or jump into common fixes when this command is part of a bigger troubleshooting path.
Related commands
Same sheet · prioritizing EXPLAIN and Plan Analysis
EXPLAIN VERBOSE
Include more detail about output columns and active settings.
Enable auto_explain
Log slow query plans automatically in the server logs.
Show effective_cache_size
Inspect a planner estimate of OS cache availability.
Show random_page_cost
Inspect a cost parameter that influences index-vs-seqscan decisions.