(2) Use and detailed explanation of Explain

columns in explain

sql statement:

EXPLAIN SELECT * from user WHERE userId=1340;

Results of the: 

1. id column

The number of the id column is the serial number of the select. There are several ids for each select, and the order of the ids increases in the order in which the select appears.

The larger the id column, the higher the execution priority. If the id is the same, it will be executed from top to bottom. If the id is NULL, it will be executed last.

2. select_type column

select_type indicates whether the corresponding row is a simple or complex query.

1) simple: simple query. The query does not contain subqueries and unions

2

Guess you like

Origin blog.csdn.net/h363659487/article/details/135184540