Re: Initialization of ResultTupleSlot in AppendNode

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Amit Kapila <amit(dot)kapila(at)huawei(dot)com>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: Initialization of ResultTupleSlot in AppendNode
Date: 2011-09-15 22:53:58
Message-ID: 14030.1316127238@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Amit Kapila <amit(dot)kapila(at)huawei(dot)com> writes:
> I observed that during initialization of planstate for Append Node, we
> allocate ResulttupleSlot, however it is used only to send NULL slot indicate
> no more tuples.

> Is it right or there is any other purpose of it?

That also holds the plan's output tuple descriptor. If you tried to
remove it, I think the ExecAssignResultTypeFromTL call would crash.
And if you removed *that*, upper nodes would get unhappy, cf
ExecGetResultType.

The use as an end-of-scan signal seems a bit vestigial, since we
could just as well return NULL, but it doesn't really cost enough
to be worth changing ...

regards, tom lane

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Andrew Dunstan 2011-09-15 23:02:58 Re: psql setenv command
Previous Message Simon Riggs 2011-09-15 22:53:57 Separating bgwriter and checkpointer