解析MYsql explain执行计划extra列输出

EXPLAIN Extra 列信息

    explain Extra列输出包含了关于mysql如何解决query的额外信息,特别是出现Using filesort 和 using temporary时,应当格外注意:

    1:Child of  'table' pushed join@1

       在做join时下推到NDB存储引擎中,引用子表‘table’,当下推join支持时,应用与Mysql cluster;

    2: const row not found

      通过一个query sql 例如 select... from tbl_name ,表为空是出现;

    3:deleting all row

      对于delete操作,一些存储引擎(MyISAM)支持一种简单并且快速的删除所有行的处理方法,如果该engine用这种优化,会显示;

    4:Distinct

      mysql查找distinct值,找到一个匹配之后就会立刻停止。

    5:FirstMatch(tbl_name)

      对tbl_name进行了semi-join firstmatch优化。

    6:Full Scan on null key

      子查询优化,当优化器不能使用索引查找访问的时候,采用回退策略。

    7:Impossible Having

     Having 语句总是 false,不能返回任何行。

    8:Impossible Where

       见上。

    9:Impoosible where noticed after reading const tables

     读完所有const(system) tables时,发现where语句总是返回false.

    10: LooseScan(m..n)

        Semi-join 松散策略被使用,m 和 n 是key 的一部分;

    11: Materialize,scan

      在mysql 5.6.7之前,这个只能用来表示物化临时表。如果有scan表示在表读取的时候没有索引临时表的索引。

      在mysql 5.6.7之后,物化由select_type使用materialized说明,并且table的值为<subqueryN>。

    12: No matching min/max row

        没有满足查询例如SELECT MIN(...) FROM ... WHERE condition的行结果。

    13: No matching row in const table

       一个查询使用了join,有空表,或者在unique index 条件下没有匹配上的行。

    14: No matching rows after partition pruning

       发生分区清理之后发现没有东西能够被delete或者update,和impossible where意思一样。

    15:  start temporary,end temporary

       表示临时表被用来semi-join去重复策略

    16:  unique row not found

      没有满足在primary key和unique上的行。

    17:  using filesort

       MySQL必须做一些事,让数据以排序的顺序被读取。

    18:  using index

      只从index上读取数据,不从表上读取数据。如果extra还有using where,意味着用使用索引来做索引查找。如果没有using where优化器会读索引但是不表示是索引查找。

    19: using index condition

      表通过上访问索引和过滤索引的方式来确定是否要读取所有的表数据。这种方式下,index condition pushdown优化。

    20: using index for group-by

      和using index 类似,这个表名mysql发现有索引可以用来group by或者distinct

    21:using join buffer(block nested loop),using join buffer(batched key access)

       block nested loop表名block nested-loop算法,batched key access表示使用batched key access算法

原文地址:https://www.cnblogs.com/onlysun/p/4513987.html