Rechercher dans le manuel MySQL
8.8.3 Extended EXPLAIN Output Format
The EXPLAIN
statement produces
extra (“extended”) information that is not part of
EXPLAIN
output but can be viewed
by issuing a SHOW WARNINGS
statement following EXPLAIN
. As
of MySQL 8.0.12, extended information is available for
SELECT
,
DELETE
,
INSERT
,
REPLACE
, and
UPDATE
statements. Prior to
8.0.12, extended information is available only for
SELECT
statements.
The Message
value in
SHOW WARNINGS
output displays how
the optimizer qualifies table and column names in the
SELECT
statement, what the
SELECT
looks like after the
application of rewriting and optimization rules, and possibly
other notes about the optimization process.
The extended information displayable with a
SHOW WARNINGS
statement following
EXPLAIN
is produced only for
SELECT
statements.
SHOW WARNINGS
displays an empty
result for other explainable statements
(DELETE
,
INSERT
,
REPLACE
, and
UPDATE
).
Here is an example of extended
EXPLAIN
output:
- mysql> EXPLAIN
- *************************** 1. row ***************************
- id: 1
- select_type: PRIMARY
- table: t1
- possible_keys: NULL
- key: PRIMARY
- key_len: 4
- ref: NULL
- rows: 4
- filtered: 100.00
- *************************** 2. row ***************************
- id: 2
- select_type: SUBQUERY
- table: t2
- possible_keys: a
- key: a
- key_len: 5
- ref: NULL
- rows: 3
- filtered: 100.00
- *************************** 1. row ***************************
- Level: Note
- Code: 1003
Because the statement displayed by SHOW
WARNINGS
may contain special markers to provide
information about query rewriting or optimizer actions, the
statement is not necessarily valid SQL and is not intended to be
executed. The output may also include rows with
Message
values that provide additional
non-SQL explanatory notes about actions taken by the optimizer.
The following list describes special markers that can appear in
the extended output displayed by SHOW
WARNINGS
:
<auto_key>
An automatically generated key for a temporary table.
<cache>(
expr
)The expression (such as a scalar subquery) is executed once and the resulting value is saved in memory for later use. For results consisting of multiple values, a temporary table may be created and you will see
<temporary table>
instead.<exists>(
query fragment
)The subquery predicate is converted to an
EXISTS
predicate and the subquery is transformed so that it can be used together with theEXISTS
predicate.<in_optimizer>(
query fragment
)This is an internal optimizer object with no user significance.
<index_lookup>(
query fragment
)The query fragment is processed using an index lookup to find qualifying rows.
<if>(
condition
,expr1
,expr2
)If the condition is true, evaluate to
expr1
, otherwiseexpr2
.<is_not_null_test>(
expr
)A test to verify that the expression does not evaluate to
NULL
.<materialize>(
query fragment
)Subquery materialization is used.
`materialized-subquery`.
col_name
A reference to the column
col_name
in an internal temporary table materialized to hold the result from evaluating a subquery.<primary_index_lookup>(
query fragment
)The query fragment is processed using a primary key lookup to find qualifying rows.
<ref_null_helper>(
expr
)This is an internal optimizer object with no user significance.
/* select#
N
*/select_stmt
The
SELECT
is associated with the row in non-extendedEXPLAIN
output that has anid
value ofN
.outer_tables
semi join (inner_tables
)A semijoin operation.
inner_tables
shows the tables that were not pulled out. See Section 8.2.2.1, “Optimizing IN and EXISTS Subquery predicates with Semijoin Transformations”.<temporary table>
This represents an internal temporary table created to cache an intermediate result.
When some tables are of const
or system
type, expressions
involving columns from these tables are evaluated early by the
optimizer and are not part of the displayed statement. However,
with FORMAT=JSON
, some
const
table accesses are
displayed as a ref
access
that uses a const value.
Nederlandse vertaling
U hebt gevraagd om deze site in het Nederlands te bezoeken. Voor nu wordt alleen de interface vertaald, maar nog niet alle inhoud.Als je me wilt helpen met vertalingen, is je bijdrage welkom. Het enige dat u hoeft te doen, is u op de site registreren en mij een bericht sturen waarin u wordt gevraagd om u toe te voegen aan de groep vertalers, zodat u de gewenste pagina's kunt vertalen. Een link onderaan elke vertaalde pagina geeft aan dat u de vertaler bent en heeft een link naar uw profiel.
Bij voorbaat dank.
Document heeft de 26/06/2006 gemaakt, de laatste keer de 26/10/2018 gewijzigd
Bron van het afgedrukte document:https://www.gaudry.be/nl/mysql-rf-explain-extended.html
De infobrol is een persoonlijke site waarvan de inhoud uitsluitend mijn verantwoordelijkheid is. De tekst is beschikbaar onder CreativeCommons-licentie (BY-NC-SA). Meer info op de gebruiksvoorwaarden en de auteur.
Referenties
Deze verwijzingen en links verwijzen naar documenten die geraadpleegd zijn tijdens het schrijven van deze pagina, of die aanvullende informatie kunnen geven, maar de auteurs van deze bronnen kunnen niet verantwoordelijk worden gehouden voor de inhoud van deze pagina.
De auteur Deze site is als enige verantwoordelijk voor de manier waarop de verschillende concepten, en de vrijheden die met de referentiewerken worden genomen, hier worden gepresenteerd. Vergeet niet dat u meerdere broninformatie moet doorgeven om het risico op fouten te verkleinen.