Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.misc -> Re: How to get Oracle to an Index without hints?
Richard Kuhler wrote:
> I played with some data and was unable to get Oracle to exhibit this > type of behavior. I'm intrigued as to what's causing it. Can you post > the column statistics as well as the index statistics? > > select column_name, num_distinct, num_nulls, > num_buckets, density > from user_tab_col_statistics > where table_name = 'PO' > and column_name in ('POS_MWBT', 'PO_AT_AT_NO', > 'PO_AT_AT_SE_SE_AG_AG_NO', 'PO_AT_AT_SE_SE_AG_AG_WG', > 'PO_AT_AT_SE_SE_NO', 'POS_ART') > > > I'd also be interested to know if Oracle thinks there's a tie between > these indexes. Can you try renaming PO_INDEX016 to PO_INDEX999 and > explain the query again (Oracle breaks ties by index name)? > > Richard >
Hello,
sorry for the late answer, but our newsserver in the company does not show me your answers until now. I will try your suggestions and post the results here.
> Richard Kuhler wrote:
And i also post the results of this SQL tomorrow.
>> > - analyzing the index (sounds obvious, but is it done?)
Yes, we analyze the table with the following statement:
ANALYZE TABLE po
COMPUTE STATISTICS FOR ALL INDEXES FOR ALL INDEXED COLUMNS FOR TABLE;
>> > - using histograms on your index (is your data evenly distibuted?)
>> > - rewriting the where clause to:
>> > WHERE ( PO_AT_AT_NO = :2 )
>> > AND ( PO_AT_AT_SE_SE_NO = :5 )
>> > AND ( PO_AT_AT_SE_SE_AG_AG_NO = :3 )
>> > AND ( PO_AT_AT_SE_SE_AG_AG_WG = :4 )
>> > AND ( POS_MWBT = :1 )
>> >
>> > provided your tool allows you to do that.
>> > If all else fails - replace tool!
Yes, we are able to change the where clause to your suggestion.
And another Info, i forgot to tell the Oracle - Version we use
It is, sorry for that, Oracle 7.3.4 and we are not able to change it in a
short time, because the OS used by the customer don´t supports any higher
version of Oracle.
As far as i know, with our installation of Oracle 8i(8.1.6 or 8.1.7) we
don´t have this problem. But i try to get sure of this point, if i am back
in the company :-)
Thx a lot for your help.
Jörg Jost
Received on Thu May 02 2002 - 14:05:22 CDT