On 7/30/07, Bharath Booshan L <[EMAIL PROTECTED]> wrote:
> Hi Tom,
>
> I have one more query regarding usage of indexes.
>
>
>
> > 2. From left to right in the same order as your index. So if you
> > create index MyIndex on MyTable ( Column1, Column2, Column3 ), then
> > you must test them in the same order, eg: where Column1 = Value1 and
> > Column2 = Value2 or Column3 = Value3. If you miss a column in the
> > sequence or place one out of order, the index won't be used from that
> > point in the test onwards.
>
>
> If I use only one of the Column i.e. Column1, Column2 or Column3 in a query
> Would it still use the index MyIndex or that we need to have the 3 Columns
> (in sequence) in the test in order to use the MyIndex?

IIRC, the index that matches the most leftmost columns will be used.
ie the index (a,b,c,d) will be used to help with queries testing
either (a), (a,b), (a,b,c), or (a,b,c,d).

> Regards,
>
> Bharath Booshan L.

-- 
Cory Nelson

-----------------------------------------------------------------------------
To unsubscribe, send email to [EMAIL PROTECTED]
-----------------------------------------------------------------------------

Reply via email to