Mysql execution plan-Extra column using index:
The Chinese name is index overwrite query: if an index is used during the query and the data you need is also a part of the index, then the using index appears.
For example:
The user table has an index key (id) and key (name)
Select id from user;
Select name from user;
Select id from user where id <9;
Select id, name from user where id <9 does not
Composite Index key (id, name)
Select id, name from user where id> 9 can also have
Using where:
The result set is filtered out based on the query conditions.
Using file sort and using temporary:
These two are the most confusing ones. many people may understand the extended meaning of their expressions. In fact, their content is very limited.
Using file sort:
Indicates that no index is used for sorting, and other sorting methods are required. The other methods here are in the memory, in the temporary file, using the dual-path sorting method, or using the whole row sorting method. However, the using file sort does not refer to any other sorting methods.
Using temporary:
Indicates that a temporary table is used. it is not clear whether the temporary table is in the memory or in the disk.
There are many situations in the two steps. Here are just a few:
Using file sort:
The first column of order by is not the index of the first table in the execution plan.
Order by has multiple columns and is not indexed on the same table
Order by columns, in ascending or descending order, inconsistent
Using temporary:
When using group by, if the columns of group by are not indexed, a temporary table is required for group. if order by is not null, file sort may be used for sorting.
If the column to be sorted is distributed on an extra table during order