Re: join and where clause equivalent ?

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: join and where clause equivalent ?
Дата
Msg-id 3102.1055261085@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: join and where clause equivalent ?  (Dmitry Tkach <dmitry@openratings.com>)
Список pgsql-novice
Dmitry Tkach <dmitry@openratings.com> writes:
> Nabil Sayegh wrote:
>> is
>> "SELECT * FROM a JOIN b USING (id_a)"
>> fully equivalent to
>> "SELECT * FROM a, b WHERE a.id_a=b.id_a" ?

> I think, the latter form gives the optimizer more freedom in choosing
> the query path.

In this case they are completely equivalent.  If you had more than two
tables (ie, nested JOIN constructs) then there'd be a difference.  See
http://www.postgresql.org/docs/view.php?version=7.3&idoc=0&file=explicit-joins.html

            regards, tom lane

В списке pgsql-novice по дате отправления:

Предыдущее
От: Josh Berkus
Дата:
Сообщение: Re: Inheritance design question
Следующее
От: Alan Searles
Дата:
Сообщение: Converting IBM DB2 TRIGGERs to PostgreSQL