Skip to content
gohacks.dev
Databases

MySQL EXPLAIN Analyzer

Paste MySQL EXPLAIN output and get each table access explained: full scans, full index scans, filesorts, temporary tables, join buffers and covering indexes.

Free · No sign-up · Your inputs stay in your browser

Input

Read a MySQL EXPLAIN plan

Output

2 table accesses, 3 notes

tabletypekeyrowsExtra
oALLNULL498211Using where; Using temporary; Using filesort
ueq_refPRIMARY1NULL
TableFindingWhat it means
oFull table scan498,211 rows read. No usable index: add one on the columns in WHERE or the join condition.
oUsing filesortRows are sorted after reading. An index whose leading columns match the WHERE equality columns and then the ORDER BY lets MySQL read them in order.
oUsing temporaryAn internal temporary table is built, typically for GROUP BY or DISTINCT on columns not in an index, or ORDER BY on a different table than the first.

Estimated rows examined across the join: about 49,821 (rows × filtered, multiplied down the plan). EXPLAIN shows estimates; EXPLAIN ANALYZE (MySQL 8.0.18+) runs the query and reports actual rows and time per step.

Runs in this browser. Nothing you paste is sent to a server.

The columns that matter

type shows how a table is read, from best to worst roughly const, eq_ref, ref, range, index, ALL. key is the index used and rows the estimate of rows read. Extra explains the costly steps: a filesort sorts after reading, and Using temporary builds an internal table. The EXPLAIN output format page documents every value.

Estimates versus reality

EXPLAIN shows the optimizer's plan and estimates without running the query. EXPLAIN ANALYZE, in MySQL 8.0.18 and later, runs it and reports actual rows and time per step, which is what to use when an estimate looks wrong.

Share

Frequently asked questions

Why does MySQL ignore my index?
Common causes: a function or type conversion on the column in WHERE (DATE(created_at) = ..., or comparing a VARCHAR to a number), a leading wildcard in LIKE, low selectivity so a scan is cheaper, or columns used in the wrong order for a composite index.
How do I remove Using filesort?
Add an index whose columns start with the WHERE equality columns and continue with the ORDER BY columns in the same order and direction, so rows are read already sorted.
Is what I paste sent anywhere?
No. The tool runs entirely in your browser with JavaScript. Nothing you type or paste is sent to our server or stored.

Keep planning

Similar tools