It looks like my patch was not analyzed by the hackers mailing list due to 
incorrect mime type, so I duplicate it here.
commit 2852a3f2fab8e723f208d81c1ad1eb6a6a377b09
Author: Denis Smirnov <darthu...@gmail.com>
Date:   Thu Aug 31 08:51:14 2023 +0700

    Change tuple table slot for Unique node to "virtual"
    
    The Unique node does a very simple thing in the plan - it processes
    the incoming sorted tuple stream and adds the unique tuples to the
    resulting tuple table slot. Previously the Unique node palloc'ed
    the results with the "miminal" tuples. It is redundant and for now
    we simply collect references to the child node tuples with the
    "virtual" tuples.

diff --git a/src/backend/executor/nodeUnique.c 
b/src/backend/executor/nodeUnique.c
index 45035d74fa..c859add6e0 100644
--- a/src/backend/executor/nodeUnique.c
+++ b/src/backend/executor/nodeUnique.c
@@ -141,7 +141,7 @@ ExecInitUnique(Unique *node, EState *estate, int eflags)
         * Initialize result slot and type. Unique nodes do no projections, so
         * initialize projection info for this node appropriately.
         */
-       ExecInitResultTupleSlotTL(&uniquestate->ps, &TTSOpsMinimalTuple);
+       ExecInitResultTupleSlotTL(&uniquestate->ps, &TTSOpsVirtual);
        uniquestate->ps.ps_ProjInfo = NULL;
 
        /*

> 31 авг. 2023 г., в 10:06, Denis Smirnov <darthu...@gmail.com> написал(а):
> 
> <v2-use-virtual-slots-for-unique-node.patch.txt>

Reply via email to