A picture to understand MySQL explain

Summary description:

  1. id: select identifier
  2. select_type: indicates the type of query.
  3. table: the table of the output result set
  4. partitions: matching partitions
  5. type: indicates the connection type of the table
  6. possible_keys: indicates the index that may be used when querying
  7. key: indicates the actual index used
  8. key_len: the length of the index field
  9. ref: column and index comparison
  10. rows: the number of rows scanned (estimated number of rows)
  11. filtered: Percentage of rows filtered by table conditions
  12. Extra: description and explanation of the implementation

Insert picture description here
note:

• explain will not tell you information about triggers, stored procedures, or the impact of user-defined functions on queries.
• explain does not consider various caches.
• explain cannot display the optimization work that MySQL has done during query execution.
• Some statistics are estimates.
Yes , it is not an exact value. • explain can only explain SELECT operations, and other operations should be rewritten as SELECT and then view the execution plan.

Original: A picture to thoroughly understand MySQL's explain

Guess you like

Origin blog.csdn.net/qq_39004843/article/details/112350485