加入收藏 | 设为首页 | 会员中心 | 我要投稿 台州站长网 (https://www.0576zz.cn/)- 边缘计算、中间件、数据处理、数据分析、智能存储!
当前位置: 首页 > 数据库 > MySql > 正文

看懂mysql执行计划--官方文档

发布时间:2020-09-02 05:10:41 所属栏目:MySql 来源:互联网
导读:原文地址:https://dev.mysql.com/doc/refman/5.7/en/explain-output.html9.8.2EXPLAIN Output FormatTheEXPLAINstatement provides information about the execution plan for aSELECTstatement.EXPLAINreturns a row of information for each table used in
identifiertype <div class="note">
<div class="admon-title">Note

JSON properties which areare not displayed in JSON-formattedoutput.

(JSON name:)

Theidentifier. This is the sequential number of thewithin the query. The value can beif the row refers to the union result of other rows. In this case,thecolumn shows a value likeM,N>to indicate that the row refers to the union of the rows withvalues ofMandN.

  • (JSON name: none)

    The type of,which can be any of those shown in the following table. A JSON-formattedexposes thetype as a property of a,unless it isor. The JSON names (where applicable) are also shown in the table.

  • Value </tr>
    <tr>
    <td scope="row"><code class="literal">PRIMARY
    </td>
    <td>None</td>
    <td>Outermost<a class="link" title="14.2.9SELECT Syntax" href="https://dev.mysql.com/doc/refman/5.7/en/select.html"&gt;<code class="literal">SELECT

    </td>

    </tr>
    <tr>
    <td scope="row"><a class="link" title="14.2.9.3UNION Syntax" href="https://dev.mysql.com/doc/refman/5.7/en/union.html"&gt;<code class="literal">UNION
    </td>
    <td>None</td>
    <td>Second or later<a class="link" title="14.2.9SELECT Syntax" href="https://dev.mysql.com/doc/refman/5.7/en/select.html"&gt;<code class="literal">SELECT
    statement in a<a class="link" title="14.2.9.3UNION Syntax" href="https://dev.mysql.com/doc/refman/5.7/en/union.html"&gt;<code class="literal">UNION

    </td>

    </tr>
    <tr>
    <td scope="row"><code class="literal">DEPENDENT UNION
    </td>
    <td>
    <code class="literal">dependent
    (<code class="literal">true
    )</td>
    <td>Second or later<a class="link" title="14.2.9SELECT Syntax" href="https://dev.mysql.com/doc/refman/5.7/en/select.html"&gt;<code class="literal">SELECT
    statement in a<a class="link" title="14.2.9.3UNION Syntax" href="https://dev.mysql.com/doc/refman/5.7/en/union.html"&gt;<code class="literal">UNION,dependent on outer query</td>

    </tr>
    <tr>
    <td scope="row"><code class="literal">UNION RESULT</td>
    <td><code class="literal">union_result</td>
    <td>Result of a<a class="link" title="14.2.9.3UNION Syntax" href="https://dev.mysql.com/doc/refman/5.7/en/union.html"&gt;<code class="literal">UNION.</td>

    (编辑:台州站长网)

    【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    原文地址:https://dev.mysql.com/doc/refman/5.7/en/explain-output.html

    Thestatement provides information about the execution plan for astatement.

    returns a row of information for each table used in thestatement. It lists the tables in the output in the order that MySQL would read them while processing the statement. MySQL resolves all joins using a nested-loop join method. This means that MySQL reads a row from the first table,and then finds a matching row in the second table,the third table,and so on. When all tables are processed,MySQL outputs the selected columns and backtracks through the table list until a table is found for which there are more matching rows. The next row is read from this table and the process continues with the next table.

    Before MySQL 5.7.3,when thekeyword is used,produces extra information that can be viewed by issuing astatement following thestatement.also displays thecolumn. See. As of MySQL 5.7.3,extended output is enabled by default and thekeyword is unnecessary.

    You cannot use theandkeywords together in the samestatement. In addition,neither of these keywords can be used together with theoption. (causesto display extended and partition information automatically; usinghas no effect onoutput.)

    Output Columns

  • Join Types

  • Extra Information

  • Output Interpretation

  • EXPLAIN Output Columns

    This section describes the output columns produced by. Later sections provide additional information about theandcolumns.

    Each output row fromprovides information about one table. Each row contains the values summarized in,and described in more detail following the table. Column names are shown in the table's first column; the second column provides the equivalent property name shown in the output whenis used.

    Table9.1EXPLAIN Output Columns

      推荐文章
        热点阅读