Re: wCTE: why not finish sub-updates at the end, not the beginning? - Mailing list pgsql-hackers

From Greg Stark
Subject Re: wCTE: why not finish sub-updates at the end, not the beginning?
Date
Msg-id AANLkTinDwQVezdd9rV_3XtvdXnYrd0k12nTpqWqectjY@mail.gmail.com
Whole thread Raw
In response to wCTE: why not finish sub-updates at the end, not the beginning?  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: wCTE: why not finish sub-updates at the end, not the beginning?
Re: wCTE: why not finish sub-updates at the end, not the beginning?
List pgsql-hackers
On Fri, Feb 25, 2011 at 2:58 PM, Tom Lane <tgl@sss.pgh.pa.us> wrote:
> However, the real reason for doing it isn't any of those, but rather
> to establish the principle that the executions of the modifying
> sub-queries are interleaved not sequential.  We're never going to be
> able to do any significant optimization of such queries if we have to
> preserve the behavior that the sub-queries execute sequentially.
> And I think it's inevitable that users will manage to build such an
> assumption into their queries if the first release with the feature
> behaves that way.

Does the interleaved execution have sane semantics?

With a query like:

WITH a as update x set x.i=x.i+1 returning x.i, b as update x set x.i=x.i+1 returning x.i
select * from a natural join b;

Is there any way to tell what it will return or what state it will
leave the table in?

--
greg


pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: wCTE behaviour
Next
From: Merlin Moncure
Date:
Subject: Re: wCTE: why not finish sub-updates at the end, not the beginning?