1996-07-09 08:22:35 +02:00
|
|
|
/*-------------------------------------------------------------------------
|
|
|
|
*
|
1999-02-14 00:22:53 +01:00
|
|
|
* execProcnode.c
|
1997-09-07 07:04:48 +02:00
|
|
|
* contains dispatch functions which call the appropriate "initialize",
|
|
|
|
* "get a tuple", and "cleanup" routines for the given node type.
|
|
|
|
* If the node has children, then it will presumably call ExecInitNode,
|
2000-01-05 19:23:54 +01:00
|
|
|
* ExecProcNode, or ExecEndNode on its subnodes and do the appropriate
|
1997-09-07 07:04:48 +02:00
|
|
|
* processing..
|
1996-07-09 08:22:35 +02:00
|
|
|
*
|
2000-01-26 06:58:53 +01:00
|
|
|
* Portions Copyright (c) 1996-2000, PostgreSQL, Inc
|
|
|
|
* Portions Copyright (c) 1994, Regents of the University of California
|
1996-07-09 08:22:35 +02:00
|
|
|
*
|
|
|
|
*
|
|
|
|
* IDENTIFICATION
|
2000-08-13 04:50:35 +02:00
|
|
|
* $Header: /cvsroot/pgsql/src/backend/executor/execProcnode.c,v 1.19 2000/08/13 02:50:03 tgl Exp $
|
1996-07-09 08:22:35 +02:00
|
|
|
*
|
|
|
|
*-------------------------------------------------------------------------
|
|
|
|
*/
|
|
|
|
/*
|
1997-09-07 07:04:48 +02:00
|
|
|
* INTERFACE ROUTINES
|
2000-01-05 19:23:54 +01:00
|
|
|
* ExecInitNode - initialize a plan node and its subplans
|
1997-09-07 07:04:48 +02:00
|
|
|
* ExecProcNode - get a tuple by executing the plan node
|
2000-01-05 19:23:54 +01:00
|
|
|
* ExecEndNode - shut down a plan node and its subplans
|
1996-07-09 08:22:35 +02:00
|
|
|
*
|
1997-09-07 07:04:48 +02:00
|
|
|
* NOTES
|
|
|
|
* This used to be three files. It is now all combined into
|
|
|
|
* one file so that it is easier to keep ExecInitNode, ExecProcNode,
|
|
|
|
* and ExecEndNode in sync when new nodes are added.
|
1996-07-09 08:22:35 +02:00
|
|
|
*
|
1997-09-07 07:04:48 +02:00
|
|
|
* EXAMPLE
|
|
|
|
* suppose we want the age of the manager of the shoe department and
|
|
|
|
* the number of employees in that department. so we have the query:
|
1996-07-09 08:22:35 +02:00
|
|
|
*
|
1997-09-07 07:04:48 +02:00
|
|
|
* retrieve (DEPT.no_emps, EMP.age)
|
|
|
|
* where EMP.name = DEPT.mgr and
|
|
|
|
* DEPT.name = "shoe"
|
1996-07-09 08:22:35 +02:00
|
|
|
*
|
1997-09-07 07:04:48 +02:00
|
|
|
* Suppose the planner gives us the following plan:
|
1996-07-09 08:22:35 +02:00
|
|
|
*
|
1997-09-07 07:04:48 +02:00
|
|
|
* Nest Loop (DEPT.mgr = EMP.name)
|
|
|
|
* / \
|
|
|
|
* / \
|
|
|
|
* Seq Scan Seq Scan
|
|
|
|
* DEPT EMP
|
|
|
|
* (name = "shoe")
|
|
|
|
*
|
|
|
|
* ExecStart() is called first.
|
|
|
|
* It calls InitPlan() which calls ExecInitNode() on
|
|
|
|
* the root of the plan -- the nest loop node.
|
|
|
|
*
|
|
|
|
* * ExecInitNode() notices that it is looking at a nest loop and
|
|
|
|
* as the code below demonstrates, it calls ExecInitNestLoop().
|
|
|
|
* Eventually this calls ExecInitNode() on the right and left subplans
|
|
|
|
* and so forth until the entire plan is initialized.
|
|
|
|
*
|
|
|
|
* * Then when ExecRun() is called, it calls ExecutePlan() which
|
|
|
|
* calls ExecProcNode() repeatedly on the top node of the plan.
|
|
|
|
* Each time this happens, ExecProcNode() will end up calling
|
|
|
|
* ExecNestLoop(), which calls ExecProcNode() on its subplans.
|
|
|
|
* Each of these subplans is a sequential scan so ExecSeqScan() is
|
|
|
|
* called. The slots returned by ExecSeqScan() may contain
|
|
|
|
* tuples which contain the attributes ExecNestLoop() uses to
|
|
|
|
* form the tuples it returns.
|
|
|
|
*
|
|
|
|
* * Eventually ExecSeqScan() stops returning tuples and the nest
|
|
|
|
* loop join ends. Lastly, ExecEnd() calls ExecEndNode() which
|
|
|
|
* calls ExecEndNestLoop() which in turn calls ExecEndNode() on
|
|
|
|
* its subplans which result in ExecEndSeqScan().
|
|
|
|
*
|
|
|
|
* This should show how the executor works by having
|
|
|
|
* ExecInitNode(), ExecProcNode() and ExecEndNode() dispatch
|
|
|
|
* their work to the appopriate node support routines which may
|
|
|
|
* in turn call these routines themselves on their subplans.
|
1996-07-09 08:22:35 +02:00
|
|
|
*
|
|
|
|
*/
|
1996-10-31 11:12:26 +01:00
|
|
|
#include "postgres.h"
|
|
|
|
|
1996-07-09 08:22:35 +02:00
|
|
|
#include "executor/executor.h"
|
1999-07-16 07:00:38 +02:00
|
|
|
#include "executor/nodeAgg.h"
|
1996-07-09 08:22:35 +02:00
|
|
|
#include "executor/nodeAppend.h"
|
|
|
|
#include "executor/nodeGroup.h"
|
|
|
|
#include "executor/nodeHash.h"
|
|
|
|
#include "executor/nodeHashjoin.h"
|
1999-07-16 07:00:38 +02:00
|
|
|
#include "executor/nodeIndexscan.h"
|
1999-11-23 21:07:06 +01:00
|
|
|
#include "executor/nodeTidscan.h"
|
1999-07-16 07:00:38 +02:00
|
|
|
#include "executor/nodeMaterial.h"
|
|
|
|
#include "executor/nodeMergejoin.h"
|
|
|
|
#include "executor/nodeNestloop.h"
|
|
|
|
#include "executor/nodeResult.h"
|
|
|
|
#include "executor/nodeSeqscan.h"
|
|
|
|
#include "executor/nodeSort.h"
|
1998-02-13 04:26:53 +01:00
|
|
|
#include "executor/nodeSubplan.h"
|
1999-07-16 07:00:38 +02:00
|
|
|
#include "executor/nodeUnique.h"
|
|
|
|
#include "miscadmin.h"
|
|
|
|
#include "tcop/tcopprot.h"
|
1996-07-09 08:22:35 +02:00
|
|
|
|
|
|
|
/* ------------------------------------------------------------------------
|
1997-09-07 07:04:48 +02:00
|
|
|
* ExecInitNode
|
|
|
|
*
|
|
|
|
* Recursively initializes all the nodes in the plan rooted
|
|
|
|
* at 'node'.
|
|
|
|
*
|
|
|
|
* Initial States:
|
|
|
|
* 'node' is the plan produced by the query planner
|
|
|
|
*
|
|
|
|
* returns TRUE/FALSE on whether the plan was successfully initialized
|
1996-07-09 08:22:35 +02:00
|
|
|
* ------------------------------------------------------------------------
|
|
|
|
*/
|
|
|
|
bool
|
1997-09-08 23:56:23 +02:00
|
|
|
ExecInitNode(Plan *node, EState *estate, Plan *parent)
|
1996-07-09 08:22:35 +02:00
|
|
|
{
|
1997-09-08 04:41:22 +02:00
|
|
|
bool result;
|
1998-02-13 04:26:53 +01:00
|
|
|
List *subp;
|
1997-09-07 07:04:48 +02:00
|
|
|
|
1996-07-09 08:22:35 +02:00
|
|
|
/* ----------------
|
1997-09-07 07:04:48 +02:00
|
|
|
* do nothing when we get to the end
|
|
|
|
* of a leaf on tree.
|
1996-07-09 08:22:35 +02:00
|
|
|
* ----------------
|
|
|
|
*/
|
1997-09-07 07:04:48 +02:00
|
|
|
if (node == NULL)
|
|
|
|
return FALSE;
|
1998-02-26 05:46:47 +01:00
|
|
|
|
|
|
|
foreach(subp, node->initPlan)
|
1998-02-13 04:26:53 +01:00
|
|
|
{
|
1998-02-26 05:46:47 +01:00
|
|
|
result = ExecInitSubPlan((SubPlan *) lfirst(subp), estate, node);
|
|
|
|
if (result == FALSE)
|
1998-09-01 05:29:17 +02:00
|
|
|
return FALSE;
|
1998-02-13 04:26:53 +01:00
|
|
|
}
|
1998-02-26 05:46:47 +01:00
|
|
|
|
1997-09-07 07:04:48 +02:00
|
|
|
switch (nodeTag(node))
|
|
|
|
{
|
1997-09-08 04:41:22 +02:00
|
|
|
/* ----------------
|
|
|
|
* control nodes
|
|
|
|
* ----------------
|
|
|
|
*/
|
|
|
|
case T_Result:
|
|
|
|
result = ExecInitResult((Result *) node, estate, parent);
|
|
|
|
break;
|
|
|
|
|
|
|
|
case T_Append:
|
|
|
|
result = ExecInitAppend((Append *) node, estate, parent);
|
|
|
|
break;
|
|
|
|
|
|
|
|
/* ----------------
|
|
|
|
* scan nodes
|
|
|
|
* ----------------
|
|
|
|
*/
|
|
|
|
case T_SeqScan:
|
|
|
|
result = ExecInitSeqScan((SeqScan *) node, estate, parent);
|
|
|
|
break;
|
|
|
|
|
|
|
|
case T_IndexScan:
|
|
|
|
result = ExecInitIndexScan((IndexScan *) node, estate, parent);
|
|
|
|
break;
|
|
|
|
|
|
|
|
/* ----------------
|
|
|
|
* join nodes
|
|
|
|
* ----------------
|
|
|
|
*/
|
|
|
|
case T_NestLoop:
|
|
|
|
result = ExecInitNestLoop((NestLoop *) node, estate, parent);
|
|
|
|
break;
|
|
|
|
|
|
|
|
case T_MergeJoin:
|
|
|
|
result = ExecInitMergeJoin((MergeJoin *) node, estate, parent);
|
|
|
|
break;
|
|
|
|
|
|
|
|
/* ----------------
|
|
|
|
* materialization nodes
|
|
|
|
* ----------------
|
|
|
|
*/
|
|
|
|
case T_Material:
|
|
|
|
result = ExecInitMaterial((Material *) node, estate, parent);
|
|
|
|
break;
|
|
|
|
|
|
|
|
case T_Sort:
|
|
|
|
result = ExecInitSort((Sort *) node, estate, parent);
|
|
|
|
break;
|
|
|
|
|
|
|
|
case T_Unique:
|
|
|
|
result = ExecInitUnique((Unique *) node, estate, parent);
|
|
|
|
break;
|
|
|
|
|
|
|
|
case T_Group:
|
|
|
|
result = ExecInitGroup((Group *) node, estate, parent);
|
|
|
|
break;
|
|
|
|
|
|
|
|
case T_Agg:
|
|
|
|
result = ExecInitAgg((Agg *) node, estate, parent);
|
|
|
|
break;
|
|
|
|
|
|
|
|
case T_Hash:
|
|
|
|
result = ExecInitHash((Hash *) node, estate, parent);
|
|
|
|
break;
|
|
|
|
|
|
|
|
case T_HashJoin:
|
|
|
|
result = ExecInitHashJoin((HashJoin *) node, estate, parent);
|
|
|
|
break;
|
|
|
|
|
1999-11-23 21:07:06 +01:00
|
|
|
case T_TidScan:
|
|
|
|
result = ExecInitTidScan((TidScan *) node, estate, parent);
|
|
|
|
break;
|
|
|
|
|
1997-09-08 04:41:22 +02:00
|
|
|
default:
|
1998-02-13 04:26:53 +01:00
|
|
|
elog(ERROR, "ExecInitNode: node %d unsupported", nodeTag(node));
|
1997-09-08 04:41:22 +02:00
|
|
|
result = FALSE;
|
1997-09-07 07:04:48 +02:00
|
|
|
}
|
1998-02-26 05:46:47 +01:00
|
|
|
|
|
|
|
if (result != FALSE)
|
1998-02-13 04:26:53 +01:00
|
|
|
{
|
1998-02-26 05:46:47 +01:00
|
|
|
foreach(subp, node->subPlan)
|
1998-02-13 04:26:53 +01:00
|
|
|
{
|
1998-02-26 05:46:47 +01:00
|
|
|
result = ExecInitSubPlan((SubPlan *) lfirst(subp), estate, node);
|
|
|
|
if (result == FALSE)
|
1998-09-01 05:29:17 +02:00
|
|
|
return FALSE;
|
1998-02-13 04:26:53 +01:00
|
|
|
}
|
|
|
|
}
|
1997-09-07 07:04:48 +02:00
|
|
|
|
|
|
|
return result;
|
1996-07-09 08:22:35 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/* ----------------------------------------------------------------
|
1997-09-07 07:04:48 +02:00
|
|
|
* ExecProcNode
|
|
|
|
*
|
|
|
|
* Initial States:
|
|
|
|
* the query tree must be initialized once by calling ExecInit.
|
1996-07-09 08:22:35 +02:00
|
|
|
* ----------------------------------------------------------------
|
|
|
|
*/
|
|
|
|
TupleTableSlot *
|
1997-09-08 23:56:23 +02:00
|
|
|
ExecProcNode(Plan *node, Plan *parent)
|
1996-07-09 08:22:35 +02:00
|
|
|
{
|
1997-09-07 07:04:48 +02:00
|
|
|
TupleTableSlot *result;
|
|
|
|
|
1996-07-09 08:22:35 +02:00
|
|
|
/* ----------------
|
1997-09-07 07:04:48 +02:00
|
|
|
* deal with NULL nodes..
|
1996-07-09 08:22:35 +02:00
|
|
|
* ----------------
|
|
|
|
*/
|
1998-05-19 20:05:58 +02:00
|
|
|
|
|
|
|
if (QueryCancel)
|
|
|
|
CancelQuery();
|
|
|
|
|
1997-09-07 07:04:48 +02:00
|
|
|
if (node == NULL)
|
|
|
|
return NULL;
|
1998-02-26 05:46:47 +01:00
|
|
|
|
|
|
|
if (node->chgParam != NULL) /* something changed */
|
|
|
|
ExecReScan(node, NULL, parent); /* let ReScan handle this */
|
|
|
|
|
1997-09-07 07:04:48 +02:00
|
|
|
switch (nodeTag(node))
|
|
|
|
{
|
1997-09-08 04:41:22 +02:00
|
|
|
/* ----------------
|
1999-03-23 17:51:04 +01:00
|
|
|
* control nodes
|
1997-09-08 04:41:22 +02:00
|
|
|
* ----------------
|
|
|
|
*/
|
|
|
|
case T_Result:
|
|
|
|
result = ExecResult((Result *) node);
|
|
|
|
break;
|
|
|
|
|
|
|
|
case T_Append:
|
|
|
|
result = ExecProcAppend((Append *) node);
|
|
|
|
break;
|
|
|
|
|
|
|
|
/* ----------------
|
|
|
|
* scan nodes
|
|
|
|
* ----------------
|
|
|
|
*/
|
|
|
|
case T_SeqScan:
|
|
|
|
result = ExecSeqScan((SeqScan *) node);
|
|
|
|
break;
|
|
|
|
|
|
|
|
case T_IndexScan:
|
|
|
|
result = ExecIndexScan((IndexScan *) node);
|
|
|
|
break;
|
|
|
|
|
|
|
|
/* ----------------
|
|
|
|
* join nodes
|
|
|
|
* ----------------
|
|
|
|
*/
|
|
|
|
case T_NestLoop:
|
2000-08-13 04:50:35 +02:00
|
|
|
result = ExecNestLoop((NestLoop *) node);
|
1997-09-08 04:41:22 +02:00
|
|
|
break;
|
|
|
|
|
|
|
|
case T_MergeJoin:
|
|
|
|
result = ExecMergeJoin((MergeJoin *) node);
|
|
|
|
break;
|
|
|
|
|
|
|
|
/* ----------------
|
|
|
|
* materialization nodes
|
|
|
|
* ----------------
|
|
|
|
*/
|
|
|
|
case T_Material:
|
|
|
|
result = ExecMaterial((Material *) node);
|
|
|
|
break;
|
|
|
|
|
|
|
|
case T_Sort:
|
|
|
|
result = ExecSort((Sort *) node);
|
|
|
|
break;
|
|
|
|
|
|
|
|
case T_Unique:
|
|
|
|
result = ExecUnique((Unique *) node);
|
|
|
|
break;
|
|
|
|
|
|
|
|
case T_Group:
|
|
|
|
result = ExecGroup((Group *) node);
|
|
|
|
break;
|
|
|
|
|
|
|
|
case T_Agg:
|
|
|
|
result = ExecAgg((Agg *) node);
|
|
|
|
break;
|
|
|
|
|
|
|
|
case T_Hash:
|
|
|
|
result = ExecHash((Hash *) node);
|
|
|
|
break;
|
|
|
|
|
|
|
|
case T_HashJoin:
|
|
|
|
result = ExecHashJoin((HashJoin *) node);
|
|
|
|
break;
|
|
|
|
|
1999-11-23 21:07:06 +01:00
|
|
|
case T_TidScan:
|
|
|
|
result = ExecTidScan((TidScan *) node);
|
|
|
|
break;
|
|
|
|
|
1997-09-08 04:41:22 +02:00
|
|
|
default:
|
1998-02-13 04:26:53 +01:00
|
|
|
elog(ERROR, "ExecProcNode: node %d unsupported", nodeTag(node));
|
|
|
|
result = NULL;
|
1997-09-07 07:04:48 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
return result;
|
1996-07-09 08:22:35 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
int
|
1997-09-08 23:56:23 +02:00
|
|
|
ExecCountSlotsNode(Plan *node)
|
1996-07-09 08:22:35 +02:00
|
|
|
{
|
1997-09-07 07:04:48 +02:00
|
|
|
if (node == (Plan *) NULL)
|
|
|
|
return 0;
|
1996-07-09 08:22:35 +02:00
|
|
|
|
1997-09-07 07:04:48 +02:00
|
|
|
switch (nodeTag(node))
|
|
|
|
{
|
1997-09-08 04:41:22 +02:00
|
|
|
/* ----------------
|
|
|
|
* control nodes
|
|
|
|
* ----------------
|
|
|
|
*/
|
|
|
|
case T_Result:
|
|
|
|
return ExecCountSlotsResult((Result *) node);
|
|
|
|
|
|
|
|
case T_Append:
|
|
|
|
return ExecCountSlotsAppend((Append *) node);
|
|
|
|
|
|
|
|
/* ----------------
|
|
|
|
* scan nodes
|
|
|
|
* ----------------
|
|
|
|
*/
|
|
|
|
case T_SeqScan:
|
|
|
|
return ExecCountSlotsSeqScan((SeqScan *) node);
|
|
|
|
|
|
|
|
case T_IndexScan:
|
|
|
|
return ExecCountSlotsIndexScan((IndexScan *) node);
|
|
|
|
|
|
|
|
/* ----------------
|
|
|
|
* join nodes
|
|
|
|
* ----------------
|
|
|
|
*/
|
|
|
|
case T_NestLoop:
|
|
|
|
return ExecCountSlotsNestLoop((NestLoop *) node);
|
|
|
|
|
|
|
|
case T_MergeJoin:
|
|
|
|
return ExecCountSlotsMergeJoin((MergeJoin *) node);
|
|
|
|
|
|
|
|
/* ----------------
|
|
|
|
* materialization nodes
|
|
|
|
* ----------------
|
|
|
|
*/
|
|
|
|
case T_Material:
|
|
|
|
return ExecCountSlotsMaterial((Material *) node);
|
|
|
|
|
|
|
|
case T_Sort:
|
|
|
|
return ExecCountSlotsSort((Sort *) node);
|
|
|
|
|
|
|
|
case T_Unique:
|
|
|
|
return ExecCountSlotsUnique((Unique *) node);
|
|
|
|
|
|
|
|
case T_Group:
|
|
|
|
return ExecCountSlotsGroup((Group *) node);
|
|
|
|
|
|
|
|
case T_Agg:
|
|
|
|
return ExecCountSlotsAgg((Agg *) node);
|
|
|
|
|
|
|
|
case T_Hash:
|
|
|
|
return ExecCountSlotsHash((Hash *) node);
|
|
|
|
|
|
|
|
case T_HashJoin:
|
|
|
|
return ExecCountSlotsHashJoin((HashJoin *) node);
|
|
|
|
|
1999-11-23 21:07:06 +01:00
|
|
|
case T_TidScan:
|
|
|
|
return ExecCountSlotsTidScan((TidScan *) node);
|
|
|
|
|
1997-09-08 04:41:22 +02:00
|
|
|
default:
|
1998-01-07 22:07:04 +01:00
|
|
|
elog(ERROR, "ExecCountSlotsNode: node not yet supported: %d",
|
1997-09-08 04:41:22 +02:00
|
|
|
nodeTag(node));
|
|
|
|
break;
|
1997-09-07 07:04:48 +02:00
|
|
|
}
|
|
|
|
return 0;
|
1996-07-09 08:22:35 +02:00
|
|
|
}
|
|
|
|
|
1997-09-07 07:04:48 +02:00
|
|
|
/* ----------------------------------------------------------------
|
|
|
|
* ExecEndNode
|
1996-07-09 08:22:35 +02:00
|
|
|
*
|
1997-09-07 07:04:48 +02:00
|
|
|
* Recursively cleans up all the nodes in the plan rooted
|
|
|
|
* at 'node'.
|
|
|
|
*
|
|
|
|
* After this operation, the query plan will not be able to
|
|
|
|
* processed any further. This should be called only after
|
|
|
|
* the query plan has been fully executed.
|
|
|
|
* ----------------------------------------------------------------
|
1996-07-09 08:22:35 +02:00
|
|
|
*/
|
|
|
|
void
|
1997-09-08 23:56:23 +02:00
|
|
|
ExecEndNode(Plan *node, Plan *parent)
|
1996-07-09 08:22:35 +02:00
|
|
|
{
|
1998-02-13 04:26:53 +01:00
|
|
|
List *subp;
|
1998-02-26 05:46:47 +01:00
|
|
|
|
1996-07-09 08:22:35 +02:00
|
|
|
/* ----------------
|
1997-09-07 07:04:48 +02:00
|
|
|
* do nothing when we get to the end
|
|
|
|
* of a leaf on tree.
|
1996-07-09 08:22:35 +02:00
|
|
|
* ----------------
|
|
|
|
*/
|
1997-09-07 07:04:48 +02:00
|
|
|
if (node == NULL)
|
|
|
|
return;
|
1998-02-26 05:46:47 +01:00
|
|
|
|
|
|
|
foreach(subp, node->initPlan)
|
|
|
|
ExecEndSubPlan((SubPlan *) lfirst(subp));
|
|
|
|
foreach(subp, node->subPlan)
|
|
|
|
ExecEndSubPlan((SubPlan *) lfirst(subp));
|
|
|
|
if (node->chgParam != NULL)
|
1998-02-13 04:26:53 +01:00
|
|
|
{
|
1998-02-26 05:46:47 +01:00
|
|
|
freeList(node->chgParam);
|
1998-02-13 04:26:53 +01:00
|
|
|
node->chgParam = NULL;
|
|
|
|
}
|
1997-09-07 07:04:48 +02:00
|
|
|
|
|
|
|
switch (nodeTag(node))
|
|
|
|
{
|
1997-09-08 04:41:22 +02:00
|
|
|
/* ----------------
|
|
|
|
* control nodes
|
|
|
|
* ----------------
|
|
|
|
*/
|
|
|
|
case T_Result:
|
|
|
|
ExecEndResult((Result *) node);
|
|
|
|
break;
|
|
|
|
|
|
|
|
case T_Append:
|
|
|
|
ExecEndAppend((Append *) node);
|
|
|
|
break;
|
|
|
|
|
|
|
|
/* ----------------
|
|
|
|
* scan nodes
|
|
|
|
* ----------------
|
|
|
|
*/
|
|
|
|
case T_SeqScan:
|
|
|
|
ExecEndSeqScan((SeqScan *) node);
|
|
|
|
break;
|
|
|
|
|
|
|
|
case T_IndexScan:
|
|
|
|
ExecEndIndexScan((IndexScan *) node);
|
|
|
|
break;
|
|
|
|
|
|
|
|
/* ----------------
|
|
|
|
* join nodes
|
|
|
|
* ----------------
|
|
|
|
*/
|
|
|
|
case T_NestLoop:
|
|
|
|
ExecEndNestLoop((NestLoop *) node);
|
|
|
|
break;
|
|
|
|
|
|
|
|
case T_MergeJoin:
|
|
|
|
ExecEndMergeJoin((MergeJoin *) node);
|
|
|
|
break;
|
|
|
|
|
|
|
|
/* ----------------
|
|
|
|
* materialization nodes
|
|
|
|
* ----------------
|
|
|
|
*/
|
|
|
|
case T_Material:
|
|
|
|
ExecEndMaterial((Material *) node);
|
|
|
|
break;
|
|
|
|
|
|
|
|
case T_Sort:
|
|
|
|
ExecEndSort((Sort *) node);
|
|
|
|
break;
|
|
|
|
|
|
|
|
case T_Unique:
|
|
|
|
ExecEndUnique((Unique *) node);
|
|
|
|
break;
|
|
|
|
|
|
|
|
case T_Group:
|
|
|
|
ExecEndGroup((Group *) node);
|
|
|
|
break;
|
|
|
|
|
|
|
|
case T_Agg:
|
|
|
|
ExecEndAgg((Agg *) node);
|
|
|
|
break;
|
|
|
|
|
|
|
|
/* ----------------
|
|
|
|
* XXX add hooks to these
|
|
|
|
* ----------------
|
|
|
|
*/
|
|
|
|
case T_Hash:
|
|
|
|
ExecEndHash((Hash *) node);
|
|
|
|
break;
|
|
|
|
|
|
|
|
case T_HashJoin:
|
|
|
|
ExecEndHashJoin((HashJoin *) node);
|
|
|
|
break;
|
|
|
|
|
1999-11-23 21:07:06 +01:00
|
|
|
case T_TidScan:
|
|
|
|
ExecEndTidScan((TidScan *) node);
|
|
|
|
break;
|
|
|
|
|
1997-09-08 04:41:22 +02:00
|
|
|
default:
|
1998-02-13 04:26:53 +01:00
|
|
|
elog(ERROR, "ExecEndNode: node %d unsupported", nodeTag(node));
|
1997-09-08 04:41:22 +02:00
|
|
|
break;
|
1997-09-07 07:04:48 +02:00
|
|
|
}
|
1996-07-09 08:22:35 +02:00
|
|
|
}
|