How do you use an execution plan to debug a slow query?hard
Answer
Check scan types, join order, estimated versus actual rows, sort steps, and index usage.
Explanation
Execution plans show how the database intends to run a query. Large sequential scans, bad estimates, missing indexes, or expensive sorts often explain latency.
Follow-upWhy can stale statistics lead to a poor query plan?