|
According to the 10053 trace in ora_23595.txt, the SQL
select * from SFISM4.R_SN_DETAIL_T WHERE IN_STATION_TIME <= SYSDATE - 30
chooses FTS because
(1) your table has 842467 blocks, Oracle uses its internal algorithm for multiblock reads to reach a cost of 187494.82 for FTS (which means the multiblock read factor is about 4.5);
(2) index range scan followed by table scan has a cost of 3274969, which is about 2 + 36015*0.41925 + 7775560*0.41925, i.e. index blevel + index leaf blocks*index selectivity + clustering factor*table selectivity (ix_sel_with_filters).
You can see the index access path is about 17 times higher. If the table and index stats are fairly accurate, you can't blame CBO. One thing you can easily verify is number of rows and blocks. If they are close to what you see in select count(*) ... and dba_segments, then check index selectivity. If you think you should only get 25% of the rows, then the selectivity of 0.41925 is way too high. Can you check again to see if the stats are up-to-date? If yes, are the data on IN_STATION_TIME somewhat skewed? If yes, try collecting a histogram with 254 buckets.
Yong Huang |
|