MySQL explains how it would process the statement, including information about how tables are joined and in which order. For information about using EXPLAIN to obtain execution plan information, see Section 8.8.2, “EXPLAIN Output Format”. 当...
6 ref_or_null:该类型类似于ref,但是MySQL会额外搜索哪些行包含了NULL。这种类型常见于解析子查询 SELECT * FROM ref_table WHERE key_column=expr OR key_column IS NULL;7 index_merge:此类型表示使用了索引合并优化,表示一个查询里面用到了多个索引 8 unique_subquery:该类型和eq_ref类似,但是使用了IN...
EXPLAIN可以使用于 SELECT, DELETE, INSERT, REPLACE,和 UPDATE语句。 当EXPLAIN与可解释的语句一起使用时,MySQL将显示来自优化器的有关语句执行计划的信息。也就是说,MySQL解释了它将如何处理该语句,包括有关如何连接表以及以何种顺序连接表的信息。 当EXPLAIN与非可解释的语句一起使用时,它将显示在命名连接中执行的...
E:fulltext:全文索引检索,要注意,全文索引的优先级很高,若全文索引和普通索引同时存在时,mysql不管代价,优先选择使用全文索引 F:ref_or_null:与ref方法类似,只是增加了null值的比较。实际用的不多。 例如: SELECT * FROM ref_table WHERE key_column=expr OR key_column IS NULL; G:index_merge:表示查询使用...
The EXPLAINstatement provides information about the execution plan for a SELECT statement. EXPLAIN returnsa row of information for each table used in the SELECT statement. It lists thetables in the output in the order that MySQL would read them while processingthe statement. MySQL resolves all joi...
explainable_stmt: {SELECTstatement|TABLEstatement|DELETEstatement|INSERTstatement|REPLACE statement|UPDATEstatement } 示例: EXPLAIN format=TRADITIONAL jsonSELECTtt.TicketNumber, tt.TimeIn, tt.ProjectReference, tt.EstimatedShipDate, tt.ActualShipDate, tt.ClientID, ...
官方文档:MySQL 参考手册 - 15.8.2 EXPLAIN Statement 标准语法: {EXPLAIN | DESCRIBE | DESC} tbl_name [col_name | wild] 1. 2. 返回值类型:Parse_tree_root对象(top_level_node),用于存储最顶层节点,即语句层级节点 Bison 语法如下: describe_stmt: ...
explain是mysql中sql优化的一个重要手段。顾名思义,explain就是解释sql,用于表示sql是怎样执行的信息,即sql执行计划! 语法 explain statement statement包括select/insert/delete/update语句。 explain会对select语句使用到每张表都会返回一行信息。在输出列出的表是按照mysql处理sql时读他们的顺序排序的。mysql使用嵌套循环...
WhenEXPLAINis used with an explainable statement, MySQL displays information from the optimizer about the statement execution plan. That is, MySQL explains how it would process the statement, including information about how tables are joined and in which order. For information about usingEXPLAINto obt...
{EXPLAIN | DESCRIBE | DESC} tbl_name [col_name | wild] {EXPLAIN | DESCRIBE | DESC} [explain_type] {explainable_stmt | FOR CONNECTION connection_id} {EXPLAIN | DESCRIBE | DESC} ANALYZE select_statement explain_type: { FORMAT = format_name } format_name: { TRADITIONAL | JSON | TREE }...