Re: to optimize a select join
- From: Mladen Gogala <gogala@xxxxxxxxxxxxx>
- Date: Sat, 29 Apr 2006 18:13:12 GMT
On Sat, 29 Apr 2006 17:55:36 +0200, Jean-Claude wrote:
1/
select *
from file1 a join file2 b on b.key=a.key
where b.data=123
and b.name='TEST'
I cannot understand why do people use that idiotic ANSI join syntax.
Relational databases model naive set theory. That means defining subsets
by setting rules on elements. Your query should be best written like
this:
select a.*,b.*
from file1 a,file2 b
where a.key=b.key and
b.data=123 and
b.name='TEST'
That way, the database optimizer doesn't have to contend with
idiotic things like "join". You should define your data and your
selection properly, index the proper columns and enjoy.
--
http://www.mgogala.com
.
- Follow-Ups:
- Re: to optimize a select join
- From: Jerry Stuckle
- Re: to optimize a select join
- References:
- to optimize a select join
- From: Jean-Claude
- to optimize a select join
- Prev by Date: Re: Line Breaks in a Textarea
- Next by Date: Re: exec returns -1
- Previous by thread: Re: to optimize a select join
- Next by thread: Re: to optimize a select join
- Index(es):