EXPLAIN output format
Select_type
Table
Type
Possible_keys
Key
Key_len
Rows
Extra
MySQL provides a EXPLAIN command that SELECT parses statements and outputs SELECT details of execution to be optimized by the developer.
The EXPLAIN command is very simple to use, with EXPLAIN in front of the SELECT statement, for example:
EXPLAIN SELECT * from user_info WHERE id < 300;
The meanings of the columns are as follows:
- The identifier for the Id:select query. Each SELECT is automatically assigned a unique identifier.
- The type of the Select_type:select query.
- Table: Which tables are queried
- Partitions: Matching partitions
- Type:join type
- Possible_keys: The index that may be selected in this query
- Key: The exact index used in this query.
- Ref: Which field or constant is used together with key
- Rows: Shows how many rows this query has scanned altogether. This is an estimate.
- Filtered: Represents the percentage of data filtered by this query condition
- Extra: Additional Information
MySQL Explain performance Analysis keywords