Re: join and where clause equivalent ?

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Dmitry Tkach <dmitry(at)openratings(dot)com>
Cc: Nabil Sayegh <postgresql(at)e-trolley(dot)de>, pgsql-novice <pgsql-novice(at)postgresql(dot)org>
Subject: Re: join and where clause equivalent ?
Date: 2003-06-10 16:04:45
Message-ID: 3102.1055261085@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-novice

Dmitry Tkach <dmitry(at)openratings(dot)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

In response to

Browse pgsql-novice by date

  From Date Subject
Next Message aakash chauhan 2003-06-10 17:28:17 Installation problem
Previous Message Josh Berkus 2003-06-10 15:58:03 Re: Inheritance design question