pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Dario Bahena Tapia <dario.mx@gmail.com>
To: Tom Lane <tgl@sss.pgh.pa.us>
Cc: Stephan Szabo <sszabo@megazone.bigpanda.com>
Cc: pgsql-sql@postgresql.org
Subject: Re: Parentheses in FROM clause and evaluation order.
Date: Mon, 15 Aug 2005 21:20:35 -0500
Message-ID: <3d104d6f0508151920fcc8a03@mail.gmail.com> (raw)
In-Reply-To: <20489.1124157760@sss.pgh.pa.us>
References: <200508110042.j7B0g1TZ015835@panselmo.fciencias.unam.mx>
	<20050815065906.K33261@megazone.bigpanda.com>
	<3d104d6f05081509345067d83b@mail.gmail.com>
	<20050815183859.U67925@megazone.bigpanda.com>
	<20489.1124157760@sss.pgh.pa.us>

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
>



view thread (6+ messages)

Message-ID: <3d104d6f0508151920fcc8a03@mail.gmail.com>
Permalink:  ../3d104d6f0508151920fcc8a03@mail.gmail.com/
Also on:    postgresql.org/message-id/3d104d6f0508151920fcc8a03@mail.gmail.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-sql@postgresql.org
  Cc: dario.mx@gmail.com, tgl@sss.pgh.pa.us, sszabo@megazone.bigpanda.com
  Subject: Re: Parentheses in FROM clause and evaluation order.
  In-Reply-To: <3d104d6f0508151920fcc8a03@mail.gmail.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox