学习oracle技术,每天学一点,每天进步一点
一个很简单的查询,为什么用不到索引
上一篇 /
下一篇 2008-04-02 10:39:07
/ 个人分类:pl/sql
http://www.itpub.net/viewthread.php?tid=964719&extra=&page=1
create table test as select rownum id,rownum-1 id2 from dba_objects;
NzmQ{&e0
?6w5e"}m] WJV"dJ0create index idx_test1 on test(id2);
I.~)h!GI9wK0ITPUB个人空间5AP7~#zyek&Y:ENEM{
analyze table test compute statistics for all indexes;ITPUB个人空间v5a*{h^
]~._
ITPUB个人空间Wu'`W/C
DIX7v
SQL> set autot on
U9m2Is!ck&a~&m!?[0SQL> select id from testITPUB个人空间
j4mL
b+R,e
2 whereITPUB个人空间:f] ]7J@T&V
3 id2 in
z/?:~M&{0 4 (ITPUB个人空间6eO0\(^BT$B&f:V7DN
5 select '2' from dual
S2j6M`&j-vo%h R9P%Cj0 6 );
`1m
[i)o8q0ITPUB个人空间4wLp5opMyWvT
ID
L5RNL5b["K8pr0----------ITPUB个人空间av~"q;p1J#z
3
mo%Ci#mUg0ITPUB个人空间3RXC|0t;~\Drc%~
ITPUB个人空间!LrsBorOY"e
Execution PlanITPUB个人空间L*U+r]!i"T
----------------------------------------------------------ITPUB个人空间 T0sD+ZY%Ld
0 SELECT STATEMENT ptimizer=CHOOSE (Cost=30 Card=8168 Bytes=7