Syntax: EXPLAIN STATEMENT>

Syntax: EXPLAIN <SELECT STATEMENT>
Explain Column Definitions
id
select_type
table
type
possible_keys
key
key_len
ref
rows
Extra
A sequential ID
See SELECT_TYPE
The table or alias
See TYPE
The possible indexes that could be used
The actually index used
See KEY_LEN
The columns (or constants) used
Approximate # of rows returned
See EXTRA
KEY_LEN
tinyint 1 byte
TIMESTAMP 4 bytes
smallint 2 bytes
DATETIME 8 bytes
INT 4 bytes
CHAR(n) n bytes
BIGINT 8 bytes
VARCHAR(n) n bytes + 2 bytes
DATE 3 bytes
NULL possible +1 byte
Warning! Multibyte characters make byte!=character. UTF8 is 3 bytes
SELECT_TYPE
SIMPLE
PRIMARY
UNION
DEPENDENT UNION
UNION RESULT
SUBQUERY
DEPENDENT
SUBQUERY
DERIVED
UNCACHEABLE
SUBQUERY
Simple SELECT
First SELECT in a UNION or outer query in a
subquery
Second or later SELECT in a UNION
Second or later SELECT in a UNION
dependent on outer query
Result of a UNION
First SELECT in a subquery
First SELECT in a subquery. It is dependent
on an outer variable
Derived table. SELECT subquery in FROM
clause
Result of subquery must be re-evaluated for
each other query row
EXTRA
const row not found
Distinct
Full scan on NULL key
Impossible HAVING
Impossible WHERE
Impossible WHERE
noticed after reading
const tables
No tables used
Not exists
Range checked for each
record (index map: N)
Select tables
optimized away
Using filesort
Using temporary
Using index
Using where
Using index for groupby
Using sort_union(...),
Using union(...),
Using intersect(...)
Using join buffer
The table was empty
Stops after first matching row
No index lookup on a subquery
HAVING is always false
WHERE is false for all rows
WHERE is false for all rows after const (and system)
tables have been read
No FROM
LEFT JOIN optimization. Stops after first row match
No good index found. One might be available as query
is processed
Only aggregate functions that can be resolved using an
index
Sorting was needed rather than using an index
During execution a temporary table was required
The query was satisfied using only an index
A WHERE clause exists
GROUP BY or DISTINCT query can be satisfied with
an index
index_merge join type
Join was performed using an internal buffer
TYPE
system
const
eq_ref
ref
fulltext
ref_or_null
index_merge
unique_subquery
index_subquery
range
index
ALL
The table has only one value (a system table)
Exactly one matching row using PRIMARY or UNIQUE
One row is matched from this table for each combination of rows
from the previous tables.
All matching rows from this table for each combination of rows
from the previous tables.
FULLTEXT index is used
ref with an additional pass for NULL values
Index merge optimization used
Optimized subquery handling in queries of the form value IN
(SELECT …) using PRIMARY or UNIQUE keys
Like unique_subquery but with non-unique indexes
KEY is compared against =, <>, >, >=, <, <=, IS
NULL, <=>, BETWEEN, or IN()
Same as ALL but only the index is scanned
Full table Scan