What data type is 'ACCNT_TYPE'?
Printable View
What data type is 'ACCNT_TYPE'?
The column is almost certainly massively skewed.Quote:
Originally posted by DaPi
Or maybe all the others are 'F'? In which case a histogram on the column should help.
The table/column names remind me of an accounting package.
The optimizer thinks it will get 36087 rows back based on 'X' distinct values and 'Y' rows (where 36087 is 'Y'/'X').
It reads about 12,000 blocks (consistent gets), so is guessing it will pick up an average of three records per block. Since it thinks it will be picking up records from every block anyway, there's no point in using an index.
Suggest you get histograms on the column ...
BEGIN
DBMS_STATS.GATHER_TABLE_STATS('MAGTAC','SSRFACC_NAME ',NULL,
DBMS_STATS.AUTO_SAMPLE_SIZE,FALSE,
'FOR ALL INDEXED COLUMNS SIZE SKEWONLY',DBMS_STATS.DEFAULT_DEGREE,
'DEFAULT',TRUE);
END;