EXPLAIN EXTENDED
Output Format
653
statement, what the
SELECT
looks like after the application of rewriting and optimization rules, and
possibly other notes about the optimization process. Here is an example:
mysql>
EXPLAIN EXTENDED
->
SELECT t1.a, t1.a IN (SELECT t2.a FROM t2) FROM t1\G
*************************** 1. row ***************************
id: 1
select_type: PRIMARY
table: t1
type: index
possible_keys: NULL
key: PRIMARY
key_len: 4
ref: NULL
rows: 4
Extra: Using index
*************************** 2. row ***************************
id: 2
select_type: DEPENDENT SUBQUERY
table: t2
type: index_subquery
possible_keys: a
key: a
key_len: 5
ref: func
rows: 2
Extra: Using index
2 rows in set, 1 warning (0.00 sec)
mysql>
SHOW WARNINGS\G
*************************** 1. row ***************************
Level: Note
Code: 1003
Message: select `test`.`t1`.`a` AS `a`,
<in_optimizer>(`test`.`t1`.`a`,
<exists>(<index_lookup>(<cache>(`test`.`t1`.`a`)
in t2 on a checking NULL having
<is_not_null_test>(`test`.`t2`.`a`)))) AS `t1.a
IN (SELECT t2.a FROM t2)` from `test`.`t1`
1 row in set (0.00 sec)
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
EXTENDED
output displayed by
SHOW
WARNINGS
:
•
<cache>(expr)
The expression (such as a scalar subquery) is executed once and the resulting value is saved in
memory for later use.
•
<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 the
EXISTS
predicate.
•
<in_optimizer>(query fragment)
This is an internal optimizer object with no user significance.
•
<index_lookup>(query fragement)
The query fragment is processed using an index lookup to find qualifying rows.
•
<is_not_null_test>(expr)
Summary of Contents for 5.0
Page 1: ...MySQL 5 0 Reference Manual ...
Page 18: ...xviii ...
Page 60: ...40 ...
Page 396: ...376 ...
Page 578: ...558 ...
Page 636: ...616 ...
Page 844: ...824 ...
Page 1234: ...1214 ...
Page 1427: ...MySQL Proxy Scripting 1407 ...
Page 1734: ...1714 ...
Page 1752: ...1732 ...
Page 1783: ...Configuring Connector ODBC 1763 ...
Page 1793: ...Connector ODBC Examples 1773 ...
Page 1839: ...Connector Net Installation 1819 2 You must choose the type of installation to perform ...
Page 2850: ...2830 ...
Page 2854: ...2834 ...
Page 2928: ...2908 ...
Page 3000: ...2980 ...
Page 3122: ...3102 ...
Page 3126: ...3106 ...
Page 3174: ...3154 ...
Page 3232: ...3212 ...