Skip site navigation (1) Skip section navigation (2)

Re: extra columns in intermediate nodes not being removed by top level of executor

From: Michael Fuhr <mike(at)fuhr(dot)org>
To: Allan Wang <allanvv(at)gmail(dot)com>
Cc: pgsql-bugs(at)postgresql(dot)org
Subject: Re: extra columns in intermediate nodes not being removed by top level of executor
Date: 2005-09-03 20:57:12
Message-ID: 20050903205712.GA2536@winnie.fuhr.org (view raw or flat)
Thread:
Lists: pgsql-bugs
On Sat, Sep 03, 2005 at 04:29:25PM -0400, Allan Wang wrote:
> I'm using 8.1 from CVS head of about two days ago.
> 
> Extra columns seem to be on sum(plays.length), videos.path, videoid

Here's a simplified, complete test case:

CREATE TABLE foo (
    x  integer,
    y  integer
);

INSERT INTO foo (x, y) VALUES (1, 2);

SELECT * FROM (SELECT sum(x), (SELECT y) AS yy FROM foo GROUP BY y) AS s LIMIT 1;
 sum | yy |   
-----+----+---
   1 |  2 | 2
(1 row)

SELECT * FROM (SELECT sum(x), (SELECT y) AS yy FROM foo GROUP BY yy) AS s LIMIT 1;
 sum | yy 
-----+----
   1 |  2
(1 row)

SELECT * FROM (SELECT sum(x), (SELECT y) AS yy FROM foo GROUP BY y) AS s;
 sum | yy 
-----+----
   1 |  2
(1 row)

SELECT * FROM (SELECT sum(x), y AS yy FROM foo GROUP BY y) AS s LIMIT 1;
 sum | yy 
-----+----
   1 |  2
(1 row)

SELECT * FROM (SELECT x, (SELECT y) AS yy FROM foo) AS s LIMIT 1;
 x | yy 
---+----
 1 |  2
(1 row)

-- 
Michael Fuhr

In response to

Responses

pgsql-bugs by date

Next:From: Garrett HeaverDate: 2005-09-04 15:49:27
Subject: GiST intarray Memory Allocation
Previous:From: Allan WangDate: 2005-09-03 20:29:25
Subject: extra columns in intermediate nodes not being removed by top levelof executor

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group