Re: wCTE behaviour - Mailing list pgsql-hackers

From Merlin Moncure
Subject Re: wCTE behaviour
Date
Msg-id AANLkTinDFtoqoRuAF33qcfq3KNz5kja=jtLoRLcFYu-c@mail.gmail.com
Whole thread Raw
In response to Re: wCTE behaviour  (David Fetter <david@fetter.org>)
List pgsql-hackers
On Thu, Nov 11, 2010 at 1:53 PM, David Fetter <david@fetter.org> wrote:
> On Thu, Nov 11, 2010 at 12:36:38PM -0500, Merlin Moncure wrote:
>> On Thu, Nov 11, 2010 at 12:13 PM, Tom Lane <tgl@sss.pgh.pa.us> wrote:
>> > then the conclusion is foregone.  To my mind, they should be thought of
>> > as running in parallel, or at least in an indeterminate order, just
>> > exactly the same way that different data modifications made in a single
>> > INSERT/UPDATE/DELETE command are considered to be made simultaneously.
>>
>> +1
>
> -1.
>
> When people want to see what has gone before, they can use RETURNING
> clauses.  With the "indeterminate order" proposal, they cannot.

If you want to see what happened 'before' you *must* use a returning
clause.  It's the link that pipelines data from one query to another.
There is in fact no 'before', just a way to define hook output into
input.  ISTM you have a lot more available routes of CTE optimization
if you go this way.

but, can you present an example of a case that depends on execution
order w/o returning? maybe I'm not seeing something...

merlin


pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: wCTE behaviour
Next
From: Tom Lane
Date:
Subject: Re: wCTE behaviour