ahfei:
oracle 高人请进,进一步发现,怎么会用不到索引?
[阅读: 469] 2011-01-19 07:35:58
select
products.adnum, products.recno
from
products
JOIN customer_acct customer_acct1 on products.ad_custid=customer_acct1.customer_id and customer_acct1.acctname='A'
and (customer_acct1.customer_id ='LE170962' )
where
(customer_acct1.customer_id ='LE170962')
------------------------
SELECT STATEMENT, GOAL = CHOOSE Cost=3942 Cardinality=846 Bytes=27918
NESTED LOOPS Cost=3942 Cardinality=846 Bytes=27918
INDEX UNIQUE SCAN Object owner=ADMAIN Object name=CUSTOMER_ACCT Cost=2 Cardinality=1 Bytes=13
TABLE ACCESS FULL Object owner=ADROP Object name=products Cost=3940 Cardinality=846 Bytes=16920
---------------------------
select
products.adnum, products.recno
from
products
JOIN customer_acct customer_acct1 on products.ad_custid=customer_acct1.customer_id and customer_acct1.acctname='A'
and (customer_acct1.customer_id like 'LE170962%' )
where
(customer_acct1.customer_id like 'LE170962%' )
-------------------------
SELECT STATEMENT, GOAL = CHOOSE Cost=699 Cardinality=1 Bytes=33
HASH JOIN Cost=699 Cardinality=1 Bytes=33
INDEX RANGE SCAN Object owner=ADMAIN Object name=CUSTOMER_ACCT Cost=3 Cardinality=1 Bytes=13
TABLE ACCESS BY INDEX ROWID Object owner=ADROP Object name=products Cost=695 Cardinality=846 Bytes=16920
INDEX SKIP SCAN Object owner=ADROP Object name=ADDUPLICATEO Cost=78 Cardinality=846
------------------------------