Icon View Thread

The following is the text of the current message along with any replies.
Messages 1 to 3 of 3 total
Thread writing joins
Tue, Oct 23 2007 10:19 AMPermanent Link

"Harry de Boer"
LS

I have two tables that I want to join. Is there a difference (in speed)
between

SELECT id, ned, dui, fra, fry, eng, volgorde, tijd_vanaf, tijd_tot, nachten,
kortingspercentage
FROM perioden
JOIN vh ON perioden.id = vh.id_huurperiode

or

SELECT id, ned, dui, fra, fry, eng, volgorde, tijd_vanaf, tijd_tot, nachten,
kortingspercentage
FROM vh
JOIN perioden ON  vh.id_huurperiode = perioden.id

More commonly said:

Should you mention the small or big table (and joined fields of them) first
in a 'normal,  not eg left' join statement.
Or does the optimizer take care of this?

Regards, Harry

Tue, Oct 23 2007 11:19 AMPermanent Link

Eryk Bottomley
Harry,

> Should you mention the small or big table (and joined fields of them) first
> in a 'normal,  not eg left' join statement.
> Or does the optimizer take care of this?

The optimiser takes care of that (unless you explicitly add the
NOJOINOPTIMIZE keyword to the query).

Eryk
Tue, Oct 23 2007 1:53 PMPermanent Link

Tim Young [Elevate Software]

Elevate Software, Inc.

Avatar

Email timyoung@elevatesoft.com

Harry,

<< I have two tables that I want to join. Is there a difference (in speed)
between >>

DBISAM and EDB handle these situations slightly differently, but the short
answer is "don't worry, the optimizer will take care of it".

--
Tim Young
Elevate Software
www.elevatesoft.com

Image