【发布时间】:2013-09-27 20:21:46
【问题描述】:
我有桌子
test_A(
id1 number,
id2 number,
id3 number,
name varchar2(10),
create_dt date
)
我在(id1,id2) 和indx2(id3) 上有两个索引一个复合索引indx1。现在当我查询这张表时test_A as
select * from test_A where id2=123 and
create_dt=(select max(create_dt) from test_A where test_A.id2=id2);
我为上面的 SQL 运行了解释计划,它使用“索引跳过扫描”。如果我在create_dt 上创建另一个索引,那么它使用索引快速全扫描和所有成本,%cpu 显示高于使用索引跳过扫描的计划。它还在create_dt 上创建索引后使用索引范围扫描。
我无法得出哪个应该可以的结论?我需要在create_dt 上创建另一个索引还是索引跳过扫描好?我相信索引跳过是 Oracle 运行多个索引范围扫描的功能?
【问题讨论】:
标签: oracle indexing database-administration