Subject Re: [ib-support] Invalid Query or Bug ?
Author Claudio Valderrama C.
""Jason Frey"" <jason_frey@...> wrote in message
news:002201c1b76d$784b3ec0$e65b0244@cx706785b...
> > In both cases I would recommend using a join based syntax as in:
>
> > SELECT x.A, y.B
> > FROM TABLEX x
> > JOIN TABLEY y WHERE Y.B = X.A
>
> This has actually been a bone of contention between me and another
> developer, re what the best way to do joins are.
>
> I had been under the impression that
>
> 'select x.a, y.b from tablex x, tabley y where y.b = x.a' is equivalant,
> both in terms of result set and in terms of execution speed as the join
> statement listed above. At least, it's the way I've been doing joins for
> years now.

In IB4, the WHERE clause was faster.
In IB5, the quasi-optimizer was fixed so the explicit JOIN syntax is a good
as or produces faster results than the old syntax. (Even MsSql recommends
the explicit JOIN syntax because their optimizer can do a better job.)

And also, there's a readability motivation: a JOIN is the place to express
which is the navigation among relations to produce a result. A WHERE is the
place to express how the final recordset is filtered. Whether you agree or
not is your decision.

C.
--
Claudio Valderrama C. - http://www.cvalde.com - http://www.firebirdSql.org
Independent developer
Owner of the Interbase® WebRing