Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.misc -> Re: Oracle Index Question
<snip>
> Optimser Mode is COST
> Stats are upto date
>
> Oracle Version is 8.1.7.4.0 on Solaris 8
>
> The colums I am interested in is ACCNT_CODE,PERIOD,ANAL_T1 &
> (IORFLM0.L0)
>
> Is it possible to build an index on these colums if so how, I would
> like to see if it makes any diffrance to speed.
>
It's not possible to build a single index on all 4 columns (if that's what you're asking). Nor is it likely to be much use building an index on any of these columns except perhaps ANAL_T1 for your example query. All the others are either just selected (L0) or are in the where clause using a between criteria with what looks to be a very large range of values. Therefore indexing them won't make any difference (probably) as Oracle would see from the stats the the between clause is not going to eliminate many records and so wouldn't bother with the index (usually).
Indexing ANAL_T1 might make a difference if the value A01 (or other values used to match SALFLDBGHF.ANAL_T1) is selective enough (i.e. there aren't more than 5%/10%/15% of the rows matching that value - choose a % based on experience, books you've read etc). Try it and see. The more rows in SAL...GHF the more selective ANAL_T1 needs to be to be worth indexing.
Andy
> Sample query
>
//////////////////////////////////////////////////////////////////////////// //////////////////////
//////////////////////////////////////////////////////////////////////////// /////////////////////////////
<snip> Received on Thu Dec 04 2003 - 05:35:38 CST
![]() |
![]() |