Get the App
SLTechnology News&Howtos  ›  Database  › 

Analysis of explain execution Plan

Shulou Source: shulou.com Published: 2022-06-01 18:04:54 09月16日 Update

Tell us how the mysql optimizer handles our sql requests

This is not to say that there is an index on the relevant query column, and mysql can use it when querying. Although we think it is appropriate, the mysql optimizer does not necessarily think so.

Mysql does not necessarily associate tables according to the order in our sql statements, but automatically adjusts the association order according to the statistics of the index.

Id:

(id can only be two values: number, null. The number represents the order / number of select operations of sql to the database, the larger the id, the higher the priority; if it is null, it represents the result set produced by several statements union)

(in the figure above, there is a total of one select statement, so id displays 1. The first table corresponds to table b, the second table a, and the third table c. It can be seen that sql does not necessarily operate according to our association order (if the id value is the same, then the order from top to bottom)

(if the id value is different, the large one is the first and then the small one)

(the id is the same and different, the first is big, and the same is from top to bottom)

Select_type:

Table: displays the table name, or aliases if any

Partitions:

The partition key tries to select the query with less cross-partition

Type:

Performance is arranged from high to low:

Extra column:

File sorting using filesort may be on disk or in memory

Using temporary is similar to using filesort, using temporary table queries

Possible_keys:

Key:

Key_len:

Ref:

Rows:

Filtered:

Tags: Order query same statement association different alias number index almost three figure above priority information memory performance situation data database quantity Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Huawei NVidia vpn Linux Redmi