Subject | Re: [firebird-support] Re: Differents results using EXISTS |
---|---|
Author | Nando Dessena |
Post date | 2008-03-26T08:03:32Z |
Sean,
S> Firebird currently has no function to parse the SQL and recognize that
S> ... where exists (select * from some_table where ..., or
S> ... where exists (select somefield from some_table where ....
S> are bad and should be replaced with
S> ... where exists (select 1 from some_table where...
I guess that Sasha's point was that it's not clear why the first two
are bad and the third is good. I for one use the third form myself
always, but I do that mainly for better code readability (as in:
always make it clear whether your goal is to select something or just
to see if anything's there). I wouldn't expect any noticeable
difference in performance (outside of the parser) among the three.
Ciao
--
Nando Dessena
======================================================
I support Firebird, I am a Firebird Foundation member!
Join today at http://www.firebirdsql.org/ff/foundation
======================================================
S> Firebird currently has no function to parse the SQL and recognize that
S> ... where exists (select * from some_table where ..., or
S> ... where exists (select somefield from some_table where ....
S> are bad and should be replaced with
S> ... where exists (select 1 from some_table where...
I guess that Sasha's point was that it's not clear why the first two
are bad and the third is good. I for one use the third form myself
always, but I do that mainly for better code readability (as in:
always make it clear whether your goal is to select something or just
to see if anything's there). I wouldn't expect any noticeable
difference in performance (outside of the parser) among the three.
Ciao
--
Nando Dessena
======================================================
I support Firebird, I am a Firebird Foundation member!
Join today at http://www.firebirdsql.org/ff/foundation
======================================================