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

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Michael Fuhr <mike(at)fuhr(dot)org>
Cc: Allan Wang <allanvv(at)gmail(dot)com>, pgsql-bugs(at)postgresql(dot)org
Subject: Re: extra columns in intermediate nodes not being removed by top level of executor
Date: 2005-09-05 00:36:15
Message-ID: 19543.1125880575@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

Michael Fuhr <mike(at)fuhr(dot)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

In response to

Browse pgsql-bugs by date

  From Date Subject
Next Message Tom Lane 2005-09-05 17:25:58 Re: extra columns in intermediate nodes not being removed by top level of executor
Previous Message Tom Lane 2005-09-04 23:11:54 Re: GiST intarray Memory Allocation