using index,using where,using temporary,using filesort

1. using temporary

using temporary 使用临时表用来存储中间数据,这个临时表的建立过程是比较耗时的
mysql官方文档:

To resolve the query, MySQL needs to create a temporary table to hold the result. 
This typically happens if the query contains GROUP BY and ORDER BY clauses that list columns differently.

mysql要使用临时表来存储中间结果集,常见于排序和分组查询

2. using where

A `WHERE` clause is used to restrict which rows to match against the next table or send to the client.
Unless you specifically intend to fetch or examine all rows from the table, 
you may have something wrong in your query if the `Extra` value is not `Using where` and the table join type is ALL or index

where 子句用于限制与下一个表匹配的行记录或发送到客户端的行记录。除非您特意打算从表中提取或检查所有行,否则如果Extra值不是Using where并且表连接类型为ALL或index,则查询可能会出错。

MySQL服务器在存储引擎收到记录后进行“后过滤”(Post-filter),如果查询未能使用索引,Using where的作用只是提醒我们MySQL将用where子句来过滤结果集。这个一般发生在MySQL服务器,而不是存储引擎层。一般发生在不能走索引扫描的情况下或者走索引扫描,但是有些查询条件不在索引当中的情况下。

3. using index

表示直接访问索引就可以获取到所需要的数据(覆盖索引),不需要通过索引回表;
一般的,若我们的type为index,但是extra中为空,则表示我们使用了索引回表

4. using filesort

mysql中无法利用索引来完成排序,这时候使用文件排序。其效率很低

你可能感兴趣的:(using index,using where,using temporary,using filesort)