Re: need enhance feature for CBO :)
Date: Tue, 11 Nov 2008 07:08:53 -0500
Message-ID: <OF0CCC54C3.C7D1AD81-ON852574FE.0042B25C-852574FE.0042B091@lnotes-gw.ent.nwie.net>
Ok i'll ask the obvious, did you gather stats on the table and indexes?
joe
Joe Testa, Oracle Certified Professional Senior Consultant
Nationwide Investments
Data Engineering and Administration
(Work) 614-677-1668
614-312-6715
From:
"Ujang Jaenudin" <ujang.jaenudin_at_gmail.com>
To:
"Oracle Discussion List" <oracle-l_at_freelists.org>,
indo-oracle_at_yahoogroups.com
Date:
11/11/2008 05:50 AM
Subject:
need enhance feature for CBO :)
Sent by:
oracle-l-bounce_at_freelists.org
dear all, (sorry cross posting)
oracle 10.1.0.5
huge machine :)
CREATE TABLE PVC
(
........
CONSTRAINT PVC_PK
PRIMARY KEY
(AN, SEQ, ES, ETI, ER)
)
ORGANIZATION INDEX <=== IOT :(
PARTITION BY RANGE (SEQ)
........... (500 partitions even more)
)
NOPARALLEL;
CREATE UNIQUE INDEX PVC_U1 ON PVC
(SEQ, ER)
LOCAL (
............ (500 partitions even more)
)
NOPARALLEL;
there are more than billion of rows
select /*+ use_index(pvc pvc_pk) */ distinct seq from pvc;
SELECT STATEMENT ALL_ROWS
PARTITION RANGE ALL
SORT UNIQUE NOSORT
INDEX FULL SCAN INDEX(UNIQUE) PVC_U1
so, my question:
- why don't oracle utilize "partition key" for this case....
(by not scanning full index will be better, because partition key
based on SEQ column).
getting list of partition key is the fastest way :)
- even when force using PVC_PK, CBO won't do it, I think scanning Primary
key
more efficient rather than roundtrip read PVC_U1 index and then again
read PVC_PK index, due to IOT mapping...
-- thanks and regards ujang | oracle dba jakarta | http://ora62.wordpress.com -- http://www.freelists.org/webpage/oracle-l -- http://www.freelists.org/webpage/oracle-lReceived on Tue Nov 11 2008 - 06:08:53 CST
