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”. 当...
set session optimizer_switch='derived_merge=off'; 关闭mysql对衍生表的合并优化,我们先看下不关闭之前,我们执行如下sql的情况: explain select (select 1 from actor where id = 1) from (select * from film where id = 1) der; 发现查询类型没有derived,我们关闭优化看下set session optimizer_switch='d...
UNCACHEABLE SUBQUERY A subquery for which the result cannot be cached and must be re-evaluated for each row of the outer query UNCACHEABLE UNION The second or later select in a UNION that belongs to an uncacheable subquery (see UNCACHEABLE SUBQUERY) SIMPLE 查询语句中不包含UNION或者子查询的...
derivedN: The row refers to the derived table result for the row with an id value of N. A derived table may result, for example, from a subquery in the FROM clause. subqueryN: The row refers to the result of a materialized subquery for the row with an id value of N. partitions (...
explain可用来分析SQL的执行计划。格式如下: 代码语言:javascript 代码运行次数:0 运行 AI代码解释 {EXPLAIN|DESCRIBE|DESC}tbl_name[col_name|wild]{EXPLAIN|DESCRIBE|DESC}[explain_type]{explainable_stmt|FORCONNECTIONconnection_id}{EXPLAIN|DESCRIBE|DESC}ANALYZEselect_statementexplain_type:{FORMAT=format_name}fo...
Query Plan Fragment 0 [SINGLE] Output layout: [c_custkey, o_orderkey, o_orderstatus] Output partitioning: SINGLE [] Stage Execution Strategy: UNGROUPED_EXECUTION - Output[c_custkey, o_orderkey, o_orderstatus] => [[c_custkey, o_orderkey, o_orderstatus]] - RemoteSource[1] => [[c...
EXPLAIN is used to obtain a query execution plan (that is, an explanation of how MySQL would execute a query). 简单翻译一下,就是explain用于获取查询执行计划(即MySQL是如何执行一个查询的)。 工作中,我们会遇到慢查询,这个时候我们就可以在select语句之前增加explain关键字,模拟MySQL优化器执行SQL语句,从而...
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...
EXPLAIN is used to obtain a query execution plan (that is, an explanation of how MySQL would execute a query). 简单翻译一下,就是explain用于获取查询执行计划(即MySQL是如何执行一个查询的)。 工作中,我们会遇到慢查询,这个时候我们就可以在select语句之前增加explain关键字,模拟MySQL优化器执行SQL语句,从而...
为了执行计划中每个结点的运行时间开销,当前的In order to measure the run-time cost of each node in the execution plan, the current implementation ofEXPLAIN ANALYZE实现为查询执行增加了 profiling overhead 。这样,在一个查询上运行EXPLAIN ANALYZE有时候比正常执行该查询要慢很多。开销的量取决于该查询的性质...