# How to Read MySQL EXPLAIN for a Slow SELECT

https://ferkesh.net/zh/knowledgebase/article/mysql-explain-select-on-staging

![Workflow: Choose representative inputs; Read the estimate; Test one change; Review deployment impact.](https://ferkesh.net/kb-media/ferkesh-guide-diagrams-batch-12.svg#mysql-explain-select-on-staging)

Start with one representative slow SELECT and a safe staging database. The plan can show expected access paths before you change an index or alter a production query.

## Procedure

1. **Choose representative inputs.** Reproduce the query against a sanctioned dataset with similar table distributions. Remove sensitive values from the notes. Check database version and schema first.
2. **Read the estimate.** Use plain EXPLAIN for your installed server. Compare the selected key, estimated rows, join order and operations reported in Extra. Keep units and estimation uncertainty explicit.
3. **Test one change.** Compare plans for the original query and a staged index or query rewrite. Measure results separately and confirm the rows returned still match. Execution-based analysis can run the statement, so apply it only where authorized.
4. **Review deployment impact.** Check index size, write cost and migration lock behavior. Retest normal workloads before recommending the smallest production change.

If several queries look plausible, [triage a MySQL slow query log safely](https://ferkesh.net/knowledgebase/article/mysql-slow-log-aggregate-triage) to identify the small set whose plans are worth investigating.

## Related guides

- [How to Investigate MySQL and MariaDB Lock Waits](https://ferkesh.net/knowledgebase/article/mysql-mariadb-lock-wait-incident)
- [How to Investigate a Slow First Server Response](https://ferkesh.net/knowledgebase/article/inspect-slow-first-response)
- [Developer Resources articles](https://ferkesh.net/knowledgebase/category/developer-resources)

## Official references

- [MySQL EXPLAIN output](https://dev.mysql.com/doc/refman/8.4/en/explain-output.html)

Ferkesh Hosting. Last reviewed November 26, 2026.
