Re: Parentheses in FROM clause and evaluation order. - Mailing list pgsql-sql

From Dario Bahena Tapia
Subject Re: Parentheses in FROM clause and evaluation order.
Date
Msg-id 3d104d6f0508151920fcc8a03@mail.gmail.com
Whole thread Raw
In response to Re: Parentheses in FROM clause and evaluation order.  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-sql
Ok, thanks for the responses guys.

Then, in the case where the final result is the same, could we think
the parentheses in the FROM clause, as a tool to clarify the query to
the user? Since in the end, this order could be changed by the
implementation for performance reasons.

salu2
dario estepario ...

2005/8/15, Tom Lane <tgl@sss.pgh.pa.us>:
> Stephan Szabo <sszabo@megazone.bigpanda.com> writes:
> > On Mon, 15 Aug 2005, Dario Bahena Tapia wrote:
> >> The final result seems to be the same, I just was curious about the
> >> standard behavior. Does the SQl says something about this execution
> >> order?
>
> > I believe SQL defines the order to pay attention to parens, so A join (B
> > join C) style clauses result in a "table" being derived from B join C and
> > another from A joined with that table.
>
> SQL only constrains the results, though.  It does not forbid the
> implementation from doing the work in whatever way seems best to it,
> so long as the results are the same (and "same" does not consider
> row ordering).
>
> For example, SQL92 3.3.4.4 says
>
>          A conforming implementation is not required to perform the exact
>          sequence of actions defined in the General Rules, but shall achieve
>          the same effect on SQL-data and schemas as that sequence.
>
>
>                         regards, tom lane
>


pgsql-sql by date:

Previous
From: Josh Berkus
Date:
Subject: Re: dates and selection
Next
From: Dario Bahena Tapia
Date:
Subject: Re: Parentheses in FROM clause and evaluation order.