Re: Initialization of ResultTupleSlot in AppendNode - Mailing list pgsql-hackers

From Tom Lane
Subject Re: Initialization of ResultTupleSlot in AppendNode
Date
Msg-id 14030.1316127238@sss.pgh.pa.us
Whole thread Raw
In response to Initialization of ResultTupleSlot in AppendNode  (Amit Kapila <amit.kapila@huawei.com>)
Responses Re: Initialization of ResultTupleSlot in AppendNode
Re: Initialization of ResultTupleSlot in AppendNode
List pgsql-hackers
Amit Kapila <amit.kapila@huawei.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


pgsql-hackers by date:

Previous
From: Josh Kupershmidt
Date:
Subject: Re: psql setenv command
Next
From: "Andrew Dunstan"
Date:
Subject: Re: psql setenv command