Re: How to share the result data of separated plan

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Hitoshi Harada <umi(dot)tanuki(at)gmail(dot)com>
Cc: Robert Haas <robertmhaas(at)gmail(dot)com>, Marko Tiikkaja <marko(dot)tiikkaja(at)cs(dot)helsinki(dot)fi>, PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: How to share the result data of separated plan
Date: 2010-11-08 17:32:16
Message-ID: 26531.1289237536@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hitoshi Harada <umi(dot)tanuki(at)gmail(dot)com> writes:
> 2010/11/9 Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)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

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Greg Stark 2010-11-08 17:36:39 Re: why does plperl cache functions using just a bool for is_trigger
Previous Message Tom Lane 2010-11-08 17:26:22 Re: How to share the result data of separated plan