From f92e8a4b5ee6a22252cbba012d629f5cefef913f Mon Sep 17 00:00:00 2001 From: Tom Lane Date: Sun, 27 Sep 2009 20:09:58 +0000 Subject: Replace the array-style TupleTable data structure with a simple List of TupleTableSlot nodes. This eliminates the need to count in advance how many Slots will be needed, which seems more than worth the small increase in the amount of palloc traffic during executor startup. The ExecCountSlots infrastructure is now all dead code, but I'll remove it in a separate commit for clarity. Per a comment from Robert Haas. --- src/backend/executor/nodeSubplan.c | 16 +++------------- 1 file changed, 3 insertions(+), 13 deletions(-) (limited to 'src/backend/executor/nodeSubplan.c') diff --git a/src/backend/executor/nodeSubplan.c b/src/backend/executor/nodeSubplan.c index 016dbc378b..753655e9a4 100644 --- a/src/backend/executor/nodeSubplan.c +++ b/src/backend/executor/nodeSubplan.c @@ -7,7 +7,7 @@ * Portions Copyright (c) 1994, Regents of the University of California * * IDENTIFICATION - * $PostgreSQL: pgsql/src/backend/executor/nodeSubplan.c,v 1.99 2009/06/11 14:48:57 momjian Exp $ + * $PostgreSQL: pgsql/src/backend/executor/nodeSubplan.c,v 1.100 2009/09/27 20:09:57 tgl Exp $ * *------------------------------------------------------------------------- */ @@ -721,7 +721,6 @@ ExecInitSubPlan(SubPlan *subplan, PlanState *parent) int ncols, i; TupleDesc tupDesc; - TupleTable tupTable; TupleTableSlot *slot; List *oplist, *lefttlist, @@ -852,15 +851,6 @@ ExecInitSubPlan(SubPlan *subplan, PlanState *parent) i++; } - /* - * Create a tupletable to hold these tuples. (Note: we never bother - * to free the tupletable explicitly; that's okay because it will - * never store raw disk tuples that might have associated buffer pins. - * The only resource involved is memory, which will be cleaned up by - * freeing the query context.) - */ - tupTable = ExecCreateTupleTable(2); - /* * Construct tupdescs, slots and projection nodes for left and right * sides. The lefthand expressions will be evaluated in the parent @@ -870,7 +860,7 @@ ExecInitSubPlan(SubPlan *subplan, PlanState *parent) * own innerecontext. */ tupDesc = ExecTypeFromTL(leftptlist, false); - slot = ExecAllocTableSlot(tupTable); + slot = ExecInitExtraTupleSlot(estate); ExecSetSlotDescriptor(slot, tupDesc); sstate->projLeft = ExecBuildProjectionInfo(lefttlist, NULL, @@ -878,7 +868,7 @@ ExecInitSubPlan(SubPlan *subplan, PlanState *parent) NULL); tupDesc = ExecTypeFromTL(rightptlist, false); - slot = ExecAllocTableSlot(tupTable); + slot = ExecInitExtraTupleSlot(estate); ExecSetSlotDescriptor(slot, tupDesc); sstate->projRight = ExecBuildProjectionInfo(righttlist, sstate->innerecontext, -- cgit v1.2.1