表示查询使用了两个以上的索引,最后取交集或者并集,常见and ,or的条件使用了不同的索引,官方排序这个在ref_or_null之后,但是实际上由于要读取多个索引,性能可能大部分时间都不如range unique_subquery 用于where中的in形式子查询,子查询返回不重复值唯一值,可以完全替换子查询,效率更高。 该类型替换了下面形式的IN子...
unique_subquery:用于where中的in查询,完全替换子查询,效率更高。语句为valueIN(SELECTprimary_keyFROMsingle_tableWHEREsome_expr)index_subquery:子查询中的返回结果字段组合是一个索引(或索引组合),但不是一个主键或唯一索引 range:索引范围查询,常见于使用=,<>,>,>=,<,<=,ISNULL,<=>,BETWEEN,IN()或者like...
GaussDB(DWS)的explain performance详解 在SQL调优过程中,经常使用explain performance,查看某个执行比较慢的SQL语句的实际执行信息和估算信息,通过对比实际执行与优化器的估算之间的差别,找到执行中的瓶颈点,来为优化提供依据。 Explain performance的结果包括七部分,分别为: 以表格形式显示的计划 Predicate Information (ide...
Using index condition: where condition contains indexed and non-indexed column and the optimizer will first resolve the indexed column and will look for the rows in the table for the other condition (index push down) Using where; Using index: 'Using index' meaning not doing the scan of entir...
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语句,从而...
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语句,从而...
system > const > eq_ref > ref > fulltext > ref_or_null >index_merge > unique_subquery > index_subquery > range> index > ALL type valuemeaning ALL 全表扫描;如果数据量大则需要进行优化 index 全索引扫描这个比 ALL 的效率要好,主要有两种情况,一种是当前的查询是覆盖索引,即需要的数据在索引中...
For more information on this behavior and how to disable it, see tidb_opt_enable_non_eval_scalar_subquery and Disable the early execution of subqueries. The statements DESC and DESCRIBE are aliases of the EXPLAIN statement. The alternative usage of EXPLAIN is documented in SHOW [FULL] COLUMNS...
1 value IN (SELECT primary_key FROM single_table WHERE some_expr) index_subquery 此连接类型类似于unique_subquery。 它代替了IN子查询,但适用于以下形式的子查询中的非唯一索引,形如: 1 value IN (SELECT key_column FROM single_table WHERE some_expr) range 使用该索引选择行,仅检索给定范围内...
Bug #48295 explain extended crash with subquery and ONLY_FULL_GROUP_BY sql_mode Submitted: 25 Oct 2009 21:10Modified: 18 Jun 2010 12:57 Reporter: Shane Bester (Platinum Quality Contributor) Email Updates: Status: Closed Impact on me: None Category: MySQL Server: OptimizerSeverity: S1 (...