Explainmysql query statement MySQLexplain
BitsCN.com
Explain mysql Query statement
Description:
SQL code
Mysql> explain SELECT 'content _ id', 'content _ old_id ', 'content _ hasimg', 'content _ time_update ', 'content _ title_long', 'vhost _ content '. 'site _ id', 'site _ domain ', 'site _ name ', 'site _ state' FROM 'vhost _ content' left join 'vhost _ site' ON 'vhost _ content '. 'site _ id' = 'vhost _ site '. 'site _ id' WHERE 'content _ effect '= 1 AND 'content _ audit' = 1 AND 'content _ publish' = 1 AND 'content _ time_update '> = '2017- 12-16 'AND 'vhost _ content '. 'site _ id' LIKE '200' AND 1 = 1 order by 'content _ time_update 'desc LIMIT 0, 25;
+ ---- + ------------- + --------------- + ------- + Response + ------------------ + --------- + ----------------------------- + ------ + ------------------------------- +
| Id | select_type | table | type | possible_keys | key | key_len | ref | rows | Extra |
+ ---- + ------------- + --------------- + ------- + Response + ------------------ + --------- + ----------------------------- + ------ + ------------------------------- +
| 1 | SIMPLE | vhost_content | range | idx_content_site, Refvhost_site483, idx_content_uptime, idx_content_publish | idx_content_site | 55 | NULL | 198 | Using where; Using filesort |
| 1 | SIMPLE | vhost_site | ref | PRIMARY | 54 | vhostdb. vhost_content.site_id | 1 |
+ ---- + ------------- + --------------- + ------- + Response + ------------------ + --------- + ----------------------------- + ------ + ------------------------------- +
Table: displays the database tables involved in the statement.
Type: This column is very important and shows the category used by the connection, whether or not indexes are used, and the statement quality. The result values are: system> const> eq_ref> ref> fulltext> ref_or_null> index_merge> unique_subquery> index_subquery> range> index> ALL. generally, make sure that the query reaches the range level at least. it is best to reach the ref level; otherwise, performance problems may occur.
Possible_key: indicates which index mysql can use to find rows in the table.
Key: displays the keys (Indexes) actually used by mysql. If no index is selected, the Key is null.
Key_len: displays the key length determined by mysql. If it is null, the length is null. the shorter the length, the better, without compromising accuracy.
Ref: displays the column or constant used with the key to select rows from the table.
Rows: displays the number of Rows that mysql considers to be checked when performing a query.
Extra: contains detailed information about mysql queries.
BitsCN.com