content_image/809582.jpg
TRADITIONAL | JSON | TREE } explainable_stmt : { SELECT statement | TABLE statement | DELETE statement | INSERT statement | REPLACE statement | UPDATE statement } 

The DESCRIBE  and EXPLAIN  statements are synonyms. In practice, the DESCRIBE  keyword is more often used to obtain information about table structure, whereas EXPLAIN  is used to obtain a query execution plan (that is, an explanation of how MySQL would execute a query). 

The following discussion uses the DESCRIBE  and EXPLAIN  keywords in accordance with those uses, but the MySQL parser treats them as completely synonymous. 

## Obtaining Table Structure Information 

•Obtaining Table Structure Information 

•Obtaining Execution Plan Information 

•Obtaining Information with EXPLAIN ANALYZE 

DESCRIBE  provides information about the columns in a table: 

mysql> DESCRIBE City; 

<img src='content_image/809582.jpg'>

DESCRIBE  is a shortcut for SHOW COLUMNS . These statements also display information for views. The description for SHOW COLUMNS  provides more information about the output columns. See Section 13.7.7.5, “SHOW COLUMNS Statement” . 

By default, DESCRIBE  displays information about all columns in the table. col_name , if given, is the name of a column in the table. In this case, the statement displays information only for the named column. wild , if given, is a pattern string. It can contain the SQL %  and _  wildcard characters. In this case, the statement displays output only for the columns with names matching the string. There is no need to enclose the string within quotation marks unless it contains spaces or other special characters. 

The DESCRIBE  statement is provided for compatibility with Oracle. 

The SHOW CREATE TABLE , SHOW TABLE STATUS , and SHOW INDEX  statements also provide information about tables. See Section 13.7.7, “SHOW Statements” . 

## Obtaining Execution Plan Information 

The EXPLAIN  statement provides information about how MySQL executes statements: 

