Re: Sequential Scans On Complex Query With UNION - see why this fails - Mailing list pgsql-novice

From Michael Glaesemann
Subject Re: Sequential Scans On Complex Query With UNION - see why this fails
Date
Msg-id 08E5AFE4-8B58-4D91-82A1-501419839BE4@myrealbox.com
Whole thread Raw
In response to Re: Sequential Scans On Complex Query With UNION - see why this fails  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: Sequential Scans On Complex Query With UNION - see why this fails
List pgsql-novice
On Jan 12, 2006, at 12:21 , Tom Lane wrote:

> I think what's happening is that the parser implicitly parenthesizes
> like this:
>
>     from ((a join b on a.x=b.y) join c on b.y=c.z)

Any idea off hand if the SQL spec has anything to say on the subject?
I haven't dug into my local version of the final draft to see.

>> I believe both join conditions and
>> restrictions are rewritten as they'd appear in the WHERE clause, so
>> you *could* put them all in the WHERE clause.
>
> Again, this is true for inner joins but very much not the case if
> any outer joins are involved.

Thanks for the clarification, Tom. While I was writing I thought that
OUTER JOIN was an exception, but I neglected to look into it or
include my thoughts.

Michael Glaesemann
grzm myrealbox com




pgsql-novice by date:

Previous
From: Tom Lane
Date:
Subject: Re: Sequential Scans On Complex Query With UNION - see why this fails
Next
From: Tom Lane
Date:
Subject: Re: Sequential Scans On Complex Query With UNION - see why this fails