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