Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Mailing Lists -> Oracle-L -> Optimizer sees index, but ignores it in access path decision process
Oracle 10.2.0.3 on Solaris.
Table is range-partitioned on TCONTRACT_TRADE_DATE. Query is
select
min(TCONTRACT_TRADE_DATE)
from ods.ods_tcontract;
A single-column partitioned index (NUK_TCONTRACT_TRD_DT) exists on TCONTRACT_TRADE_DATE. Another (composite) index contains that column in position 2. Optimizer chooses the second index every time, even when a hint specifies the first one.
Optimizer (event 10053) trace shows awareness of the preferred index:
Index Stats::
Index: NUK_TCONTRACT_BUSDATE_CUSIP Col#: 52 20
USING COMPOSITE STATS
LVLS: 3 #LB: 713238 #DK: 384265 LB/K: 1.00 DB/K: 86.00 CLUF:
33203958.00
Index: NUK_TCONTRACT_CUSIP Col#: 20 35 57 1
USING COMPOSITE STATS
LVLS: 3 #LB: 955919 #DK: 112199564 LB/K: 1.00 DB/K: 1.00 CLUF:
43217198.00
Index: NUK_TCONTRACT_TRD_DT Col#: 35
USING COMPOSITE STATS
LVLS: 3 #LB: 402118 #DK: 80 LB/K: 5026.00 DB/K: 52071.00 CLUF:
4165752.00
But, in next section of trace, in which access paths are considered, NUK_TCONTRACT_TRD_DT does not appear at all (see below). How can that be?
Paul Baumgartel
CREDIT SUISSE
Information Technology
Securities Processing Databases Americas
One Madison Avenue
New York, NY 10010
USA
Phone 212.538.1143
paul.baumgartel_at_credit-suisse.com
www.credit-suisse.com
SINGLE TABLE ACCESS PATH
Table: ODS_TCONTRACT Alias: ODS_TCONTRACT
Card: Original: 115569516 Rounded: 115569516 Computed:
115569516.00 Non Adjusted: 115569516.00
Access Path: TableScan
Cost: 7280284.59 Resp: 7280284.59 Degree: 0
Cost_io: 7028169.00 Cost_cpu: 193577124940 Resp_io: 7028169.00 Resp_cpu: 193577124940 Access Path: index (index (FFS))
Cost_io: 489938.00 Cost_cpu: 20271467483 Resp_io: 489938.00 Resp_cpu: 20271467483 Access Path: index (index (FFS))
Cost_io: 364308.00 Cost_cpu: 18525881475 Resp_io: 364308.00 Resp_cpu: 18525881475 Access Path: index (FullScan)
http://www.credit-suisse.com/legal/en/disclaimer_email_ib.html
-- http://www.freelists.org/webpage/oracle-lReceived on Fri Sep 28 2007 - 15:35:53 CDT