Re: How to share the result data of separated plan - Mailing list pgsql-hackers

From Tom Lane
Subject Re: How to share the result data of separated plan
Date
Msg-id 26531.1289237536@sss.pgh.pa.us
Whole thread Raw
In response to Re: How to share the result data of separated plan  (Hitoshi Harada <umi.tanuki@gmail.com>)
Responses Re: How to share the result data of separated plan
List pgsql-hackers
Hitoshi Harada <umi.tanuki@gmail.com> writes:
> 2010/11/9 Tom Lane <tgl@sss.pgh.pa.us>:
>> My opinion is still the same as here:
>> http://archives.postgresql.org/pgsql-hackers/2010-02/msg00688.php

> Current consensus says:

> WITH x AS (SELECT count(*) FROM t), y AS (DELETE FROM t), z AS (SELECT
> count(*) FROM t) SELECT x.count, z.count FROM x, z;

> should return 0 for z.count but some number of original rows for
> x.count.

Consensus according to who?  It's at least as consistent for all the
queries to start from the same snapshot, meaning that x and z would
produce the same results (independent of what y does).

It might be worth inspecting the SQL2011 draft to see if they provide
any guidance on what ought to happen here.
        regards, tom lane


pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: How to share the result data of separated plan
Next
From: Greg Stark
Date:
Subject: Re: why does plperl cache functions using just a bool for is_trigger