<pre name="code" class="html">SQL> alter session set statistics_level=all; Session altered. SQL> select e.ename,e.job,d.dname from emp e,dept d where e.deptno=d.deptno and e.sal<2000; -------------------省略输出结果-----------…
关于如何理解MySQL执行计划中Extra列的Using where.Using Index.Using index condition,Using index,Using where这四者的区别.首先,我们来看看官方文档关于三者的简单介绍(官方文档并没有介绍Using index,Using where这种情况): Using index (JSON property: using_index) The column information is retrieved from the ta…
我们经常使用 MySQL 的执行计划来查看 SQL 语句的执行效率,接下来分析执行计划的各个显示内容. EXPLAIN SELECT * FROM users WHERE id IN (SELECT userID FROMuser_address WHERE address = "湖南长沙麓谷") ; 执行计划的 id select 查询的序列号,标识执行的顺序 id 相同,执行顺序由上至下 id 不同,如果是子查询,id 的序号会递增,id 值越大优先级越高,越先被执行 执行计划的…