Explain SQL statement Performance detection

Source: Internet
Author: User

Typically used to parse how SQL statements are executed, using those keys

Mysql>explain select * FROM table;
+----+-------------+-------+------+---------------+------+---------+------+------+-------+
| ID | Select_type | Table | Type | Possible_keys | Key | Key_len | Ref | Rows | Extra |
+----+-------------+-------+------+---------------+------+---------+------+------+-------+


table           # Displays the table involved in the statement
type            # reflect the quality of the statement, excellent-to-poor: const > Eq_reg > Ref > Range > Indexhe > All
Possible_keys
& nbsp #存在表中的所有索引
key              #使用到的索引
key_len          #索引长度, as short as possible
ref              #显示索引的那一列被用到
rows             #语句返回的数据行数
Extra            #语句查询情况的详细信息

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.