MySQL explain command view statement execution overview

Source: Internet
Author: User

In MySQL, you can use the explain command to see how a query statement is executed, using a method Example: Explain + query statement

Example: Explain select * FROM User_info

A few important field descriptions:

Table: Which data table is associated with this query operation

Type: Connection query operation types, generally according to the index query is const, if there is no index, then traverse all the data is all (this method is very inefficient)

Possible_keys: Displays the indexes that may be applied to this table. If it is empty, there is no possible index.

Key: The actual index used. If NULL, the index is not used.

Key_len: The length of the index used. The shorter the length the better, without loss of accuracy

Ref: Shows which column of the index is being used and, if possible, a constant

Rows: Returns the number of rows for the requested data

Extra: The additional information of the inquiry, is not clear for the time being, later accumulates ...

MySQL explain command view statement execution overview

Related Article

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.