EXPLAIN [explain_type] SELECTselect_optionsexplain_type: EXTENDED | PARTITIONS
Or:
EXPLAIN tbl_name
The EXPLAIN statement can be used
either as a way to obtain information about how MySQL executes a
statement, or as a synonym for
DESCRIBE:
When you precede a SELECT
statement with the keyword
EXPLAIN, MySQL displays
information from the optimizer about the query execution plan.
That is, MySQL explains how it would process the statement,
including information about how tables are joined and in which
order. EXPLAIN EXTENDED can be
used to obtain additional information.
For information about using
EXPLAIN and
EXPLAIN EXTENDED to obtain
query execution plan information, see
Section 8.8.1, “Optimizing Queries with EXPLAIN”.
EXPLAIN
PARTITIONS is useful only when examining queries
involving partitioned tables. For details, see
Section 18.3.4, “Obtaining Information About Partitions”.
EXPLAIN
is synonymous
with tbl_nameDESCRIBE
or tbl_nameSHOW
COLUMNS FROM .
For information about tbl_nameDESCRIBE
and SHOW COLUMNS, see
Section 13.8.1, “DESCRIBE Syntax”, and
Section 13.7.5.6, “SHOW COLUMNS Syntax”.

User Comments
Add your own comment.