Inspect the execution plan for a SELECT statement.
Section: Execution Plans
Explain a query
sql
sql
EXPLAIN
SELECT *
FROM orders
WHERE customer_id = 42;Explanation
EXPLAIN reveals how the optimizer plans to execute the query.
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 Execution Plans
Explain with runtime stats
Run a query and collect timing or actual row information where supported.
Index a common lookup column
Speed up frequent equality or range predicates.
Use keyset pagination
Paginate by a stable cursor instead of a large OFFSET.
Avoid wrapping indexed columns in functions
Preserve index usability in predicates.