An execution plan shows how the database intends to execute your query.
You can inspect it using:
EXPLAIN
Some databases support:
EXPLAIN ANALYZE
EXPLAIN shows the planned operations.
EXPLAIN ANALYZE runs the query and reports real runtime stats (on engines that support it).
Look for things like:
- Table scans
- Index scans
- Join methods
- Estimated vs actual rows
- Sort operations
- Expensive operations