From: Dario Bahena Tapia <dario.mx@gmail.com>
To: 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 11:34:32 -0500
Message-ID: <3d104d6f05081509345067d83b@mail.gmail.com> (raw)
In-Reply-To: <20050815065906.K33261@megazone.bigpanda.com>
References: <200508110042.j7B0g1TZ015835@panselmo.fciencias.unam.mx>
<20050815065906.K33261@megazone.bigpanda.com>
Hi,
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?
Thanks for your response.
salu2
dario estepario ...
2005/8/15, Stephan Szabo <sszabo@megazone.bigpanda.com>:
> On Wed, 10 Aug 2005 dario.mx@gmail.com wrote:
>
> > I thought that the parenthesis in the table expression
> > (FROM clause), could be used to indicate the desired
> > evaluation order. But, I tried with a couple of samples
> > and the explain command returned me the same result; no matter
> > what parentheses association I used. I am using only INNER JOINs.
> >
> > In fact, I thought that the whole table expression was gonna be
> > evaluated before the WHERE filter. Does the stantard says something
> > about this evaluation order when the parentheses are present?
> > Does PostgreSQL implements this behavior?
>
> AFAIK we only try to provide final results that are equivalent to
> following the steps in order, so it'll reorder joins or push clauses
> around as long as it thinks the semantics of the query won't change. For
> example, actually doing unconstrainted joins before where clauses is a
> very bad plan if you've got a FROM table1, table2, table3 style query. If
> you're seeing a place where the reorder affects the query results as
> opposed to the query plan, that's probably a bug, can you give more
> information?
>
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, sszabo@megazone.bigpanda.com
Subject: Re: Parentheses in FROM clause and evaluation order.
In-Reply-To: <3d104d6f05081509345067d83b@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