List:General Discussion« Previous MessageNext Message »
From:Chris Date:August 20 2006 9:39pm
Subject:Re: Should Joins always be using an index? (where possible?)
View as plain text  
Ow Mun Heng wrote:
> On Sun, 2006-08-20 at 19:59 +1000, chris smith wrote:
>> On 8/20/06, Ow Mun Heng <Ow.Mun.Heng@stripped> wrote:
>>> I'm have a query like so
>>>
>>> select
>>> A,
>>> index_A
>>> from
>>> tableA
>>> join tableB
>>> on tableB.indexA = tableA.indexA
>>>
>>>
>>> select
>>> A,
>>> index_A
>>> from
>>> tableA
>>> join tableB
>>> on tableB.A = tableA.A
>>>
>>> whcih would be more efficient? using the where clause which uses the
>>> index or the one which isn't index?
>> If you join using the field that is indexed, this will use an index.
>>
>> If you join using the field that isn't indexed, it can't use an index.
> 
> I take it that that means yes, it's more efficient performance wise to
> always use an index.

Of course, same as any query ;)
Thread
Should Joins always be using an index? (where possible?)Ow Mun Heng20 Aug
  • Re: Should Joins always be using an index? (where possible?)chris smith20 Aug
    • Re: Should Joins always be using an index? (where possible?)Ow Mun Heng20 Aug
      • Re: Should Joins always be using an index? (where possible?)Chris20 Aug
        • [SOLVED] Re: Should Joins always be using an index? (wherepossible?)Ow Mun Heng21 Aug