Re: extra columns in intermediate nodes not being removed by top level of executor - Mailing list pgsql-bugs

From Tom Lane
Subject Re: extra columns in intermediate nodes not being removed by top level of executor
Date
Msg-id 19543.1125880575@sss.pgh.pa.us
Whole thread Raw
In response to Re: extra columns in intermediate nodes not being removed by top level of executor  (Michael Fuhr <mike@fuhr.org>)
List pgsql-bugs
Michael Fuhr <mike@fuhr.org> writes:
> On Sat, Sep 03, 2005 at 04:29:25PM -0400, Allan Wang wrote:
>> Extra columns seem to be on sum(plays.length), videos.path, videoid

> Here's a simplified, complete test case:

Thanks for the test case.  The bug seems to be introduced by the code
I added a couple months ago to eliminate unnecessary SubqueryScan plan
nodes: the Limit node ends up with a targetlist different from its
immediate input node, which is wrong because Limit doesn't do any
projection, only pass on its input tuples (or not).  There are probably
related cases involving Sort nodes (ORDER BY on a sub-select) and other
plan nodes that don't do projection.  Haven't decided on an appropriate
fix yet --- seems we have to either prevent the SubqueryScan from being
removed in this context, or fix the tlist of the parent node.  Don't
know which will be less messy.

            regards, tom lane

pgsql-bugs by date:

Previous
From: Tom Lane
Date:
Subject: Re: GiST intarray Memory Allocation
Next
From: Tom Lane
Date:
Subject: Re: extra columns in intermediate nodes not being removed by top level of executor