MySQL EXPLAIN Analyzer
MySQL's EXPLAIN output packs a lot into a few columns — type, key, rows, filtered and the Extra flags — and EXPLAIN ANALYZE adds a tree of timings on top. Paste any of the formats here and get each table access explained in plain English, with full table scans, unused candidate indexes, filesorts, temporary tables, join buffers, dependent subqueries and bad row estimates flagged. Everything runs in your browser; your plan never leaves your machine.
Do more than mysql explain analyzer — meet Chat2DB
Chat2DB is an AI-powered SQL client for Windows, macOS and Linux. Write SQL in natural language, format and optimize queries automatically, and manage MySQL, PostgreSQL, Oracle and 20+ other databases in one workspace.
How to use
- Run EXPLAIN your_query; (or EXPLAIN FORMAT=JSON, or EXPLAIN ANALYZE on MySQL 8.0.18+) in the mysql client or your SQL editor.
- Paste the complete output — the bordered table, tab-separated rows, \G vertical output, JSON or the -> tree — into the box below.
- Click Analyze and work through the red and yellow findings first, starting with full scans on large tables.
Frequently asked questions
Which EXPLAIN type values are bad in MySQL?
From best to worst the common access types are system, const, eq_ref, ref, range, index and ALL. ALL is a full table scan and index is a full index scan; both read everything, so they are the first thing to look at when the rows estimate is large. On a table with a few hundred rows a full scan is often the cheapest plan and nothing needs fixing.
What do Using filesort and Using temporary mean?
Using filesort means MySQL sorts rows after reading them instead of reading them in index order; it does not necessarily touch disk. Using temporary means an internal temporary table is built, typically for GROUP BY, DISTINCT or UNION. Both are cheap on small result sets but get expensive as rows grow. An index whose column order matches the ORDER BY or GROUP BY, after the equality filters, usually removes them.
What is the difference between EXPLAIN and EXPLAIN ANALYZE in MySQL?
EXPLAIN shows the optimizer's plan and its row estimates without running the query. EXPLAIN ANALYZE, available since MySQL 8.0.18, actually executes the query and prints the plan as a tree with real timings, row counts and loops for every step, so you can see where time is spent and where estimates were wrong. Because it runs the statement, do not use it on writes you do not want to happen.
