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
Views: Raw Message | Whole Thread | Download mbox | Resend email
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

Browse pgsql-bugs by date

  From Date Subject
Next Message Garrett Heaver 2005-09-04 15:49:27 GiST intarray Memory Allocation
Previous Message Allan Wang 2005-09-03 20:29:25 extra columns in intermediate nodes not being removed by top level of executor