首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 数据库 > oracle >

exists里面会走索引吗解决方案

2012-01-09 
exists里面会走索引吗假设在emp表的deptno列建了一个普通索引在我执行:SQL codedelete from scott.emp whe

exists里面会走索引吗
假设在emp表的deptno列建了一个普通索引
在我执行:

SQL code
delete from scott.emp where empno > 7800   and exists (select null          from scott.dept         where scott.dept. deptno = scott.emp.deptno);

在执行计划里发现没有走deptno上的索引,这是为什么?
假设走了索引在速度上会不会有很大提升(在emp、dept表数据量特别大的时候)。

[解决办法]
没走索引可能因为你的数据量很小,扫描索引块的成本已高过全表扫表的成本
数据量大肯定会走索引的

热点排行