aboutsummaryrefslogtreecommitdiff
path: root/src/include/executor
diff options
context:
space:
mode:
authorMarc G. Fournier <scrappy@hub.org>1996-08-28 07:27:54 +0000
committerMarc G. Fournier <scrappy@hub.org>1996-08-28 07:27:54 +0000
commit870be9fa8e5ead7a9fec1b1cf539c701bba57d2a (patch)
tree0980ed1b45ec7974d2ceea9df3d0570c165804b6 /src/include/executor
parent907c884fe8b88d3df5883c278cacb094a1cfc7ac (diff)
downloadpostgresql-870be9fa8e5ead7a9fec1b1cf539c701bba57d2a.tar.gz
postgresql-870be9fa8e5ead7a9fec1b1cf539c701bba57d2a.zip
Clean up th ecompile process by centralizing the include files
- code compile tested, but due to a yet unresolved problem with parse.h's creation, compile not completed...
Diffstat (limited to 'src/include/executor')
-rw-r--r--src/include/executor/execFlatten.h26
-rw-r--r--src/include/executor/execdebug.h377
-rw-r--r--src/include/executor/execdefs.h47
-rw-r--r--src/include/executor/execdesc.h38
-rw-r--r--src/include/executor/executor.h229
-rw-r--r--src/include/executor/functions.h22
-rw-r--r--src/include/executor/hashjoin.h82
-rw-r--r--src/include/executor/nodeAgg.h21
-rw-r--r--src/include/executor/nodeAppend.h22
-rw-r--r--src/include/executor/nodeGroup.h21
-rw-r--r--src/include/executor/nodeHash.h35
-rw-r--r--src/include/executor/nodeHashjoin.h33
-rw-r--r--src/include/executor/nodeIndexscan.h32
-rw-r--r--src/include/executor/nodeMaterial.h23
-rw-r--r--src/include/executor/nodeMergejoin.h40
-rw-r--r--src/include/executor/nodeNestloop.h21
-rw-r--r--src/include/executor/nodeResult.h21
-rw-r--r--src/include/executor/nodeSeqscan.h27
-rw-r--r--src/include/executor/nodeSort.h23
-rw-r--r--src/include/executor/nodeTee.h22
-rw-r--r--src/include/executor/nodeUnique.h21
-rw-r--r--src/include/executor/tuptable.h72
22 files changed, 1255 insertions, 0 deletions
diff --git a/src/include/executor/execFlatten.h b/src/include/executor/execFlatten.h
new file mode 100644
index 00000000000..e42d5e09d97
--- /dev/null
+++ b/src/include/executor/execFlatten.h
@@ -0,0 +1,26 @@
+/*-------------------------------------------------------------------------
+ *
+ * execFlatten.h--
+ * prototypes for execFlatten.c.
+ *
+ *
+ * Copyright (c) 1994, Regents of the University of California
+ *
+ * $Id: execFlatten.h,v 1.1 1996/08/28 07:22:04 scrappy Exp $
+ *
+ *-------------------------------------------------------------------------
+ */
+#ifndef EXECFLATTEN_H
+#define EXECFLATTEN_H
+
+extern Datum ExecEvalIter(Iter *iterNode, ExprContext *econtext, bool *resultIsNull, bool *iterIsDone);
+
+extern void ExecEvalFjoin(TargetEntry *tlist, ExprContext *econtext, bool *isNullVect, bool *fj_isDone);
+
+extern bool FjoinBumpOuterNodes(TargetEntry *tlist, ExprContext *econtext, DatumPtr results, char *nulls);
+
+
+#endif /* EXECFLATTEN_H */
+
+
+
diff --git a/src/include/executor/execdebug.h b/src/include/executor/execdebug.h
new file mode 100644
index 00000000000..29638d658a9
--- /dev/null
+++ b/src/include/executor/execdebug.h
@@ -0,0 +1,377 @@
+/*-------------------------------------------------------------------------
+ *
+ * execdebug.h--
+ * #defines governing debugging behaviour in the executor
+ *
+ *
+ * Copyright (c) 1994, Regents of the University of California
+ *
+ * $Id: execdebug.h,v 1.1 1996/08/28 07:22:06 scrappy Exp $
+ *
+ *-------------------------------------------------------------------------
+ */
+#ifndef EXECDEBUG_H
+#define EXECDEBUG_H
+
+/* ----------------------------------------------------------------
+ * debugging defines.
+ *
+ * If you want certain debugging behaviour, then #define
+ * the variable to 1, else #undef it. -cim 10/26/89
+ * ----------------------------------------------------------------
+ */
+
+/* ----------------
+ * EXEC_DEBUGSTORETUP is for tuple table debugging - this
+ * will print a message every time we call ExecStoreTuple.
+ * -cim 3/20/91
+ * ----------------
+ */
+#undef EXEC_DEBUGSTORETUP
+
+/* ----------------
+ * EXEC_TUPLECOUNT is a #define which causes the
+ * executor keep track of tuple counts. This might be
+ * causing some problems with the decstation stuff so
+ * you might want to undefine this if you are doing work
+ * on the decs - cim 10/20/89
+ * ----------------
+ */
+#undef EXEC_TUPLECOUNT
+
+/* ----------------
+ * EXEC_SHOWBUFSTATS controls whether or not buffer statistics
+ * are shown for each query. -cim 2/9/89
+ * ----------------
+ */
+#undef EXEC_SHOWBUFSTATS
+
+/* ----------------
+ * EXEC_CONTEXTDEBUG turns on the printing of debugging information
+ * by CXT_printf() calls regarding which memory context is the
+ * CurrentMemoryContext for palloc() calls.
+ * ----------------
+ */
+#undef EXEC_CONTEXTDEBUG
+
+/* ----------------
+ * EXEC_RETURNSIZE is a compile flag governing the
+ * behaviour of lispFmgr.. See ExecMakeFunctionResult().
+ * Undefining this avoids a problem in the system cache.
+ *
+ * Note: undefining this means that there is incorrect
+ * information in the const nodes corresponding
+ * to function (or operator) results. The thing is,
+ * 99% of the time this is fine because when you do
+ * something like x = emp.sal + 1, you already know
+ * the type and size of x so the fact that + didn't
+ * return the correct size doesn't matter.
+ * With variable length stuff the size is stored in
+ * the first few bytes of the data so again, it's
+ * not likely to matter.
+ * ----------------
+ */
+#undef EXEC_RETURNSIZE
+
+/* ----------------
+ * EXEC_UTILSDEBUG is a flag which turns on debugging of the
+ * executor utilities by EU_printf() in eutils.c
+ * ----------------
+ */
+#undef EXEC_UTILSDEBUG
+
+/* ----------------
+ * EXEC_NESTLOOPDEBUG is a flag which turns on debugging of the
+ * nest loop node by NL_printf() and ENL_printf() in nestloop.c
+ * ----------------
+ */
+#undef EXEC_NESTLOOPDEBUG
+
+/* ----------------
+ * EXEC_PROCDEBUG is a flag which turns on debugging of
+ * ExecProcNode() by PN_printf() in procnode.c
+ * ----------------
+ */
+#undef EXEC_PROCDEBUG
+
+/* ----------------
+ * EXEC_EVALDEBUG is a flag which turns on debugging of
+ * ExecEval and ExecTargetList() stuff by EV_printf() in qual.c
+ * ----------------
+ */
+#undef EXEC_EVALDEBUG
+
+/* ----------------
+ * EXEC_SCANDEBUG is a flag which turns on debugging of
+ * the ExecSeqScan() stuff by S_printf() in seqscan.c
+ * ----------------
+ */
+#undef EXEC_SCANDEBUG
+
+/* ----------------
+ * EXEC_SORTDEBUG is a flag which turns on debugging of
+ * the ExecSort() stuff by SO_printf() in sort.c
+ * ----------------
+ */
+#undef EXEC_SORTDEBUG
+
+/* ----------------
+ * EXEC_MERGEJOINDEBUG is a flag which turns on debugging of
+ * the ExecMergeJoin() stuff by MJ_printf() in mergejoin.c
+ * ----------------
+ */
+#undef EXEC_MERGEJOINDEBUG
+
+/* ----------------
+ * EXEC_MERGEJOINPFREE is a flag which causes merge joins
+ * to pfree intermittant tuples (which is the proper thing)
+ * Not defining this means we avoid menory management problems
+ * at the cost of doing deallocation of stuff only at the
+ * end of the transaction
+ * ----------------
+ */
+#undef EXEC_MERGEJOINPFREE
+
+/* ----------------
+ * EXEC_DEBUGINTERACTIVE is a flag which enables the
+ * user to issue "DEBUG" commands from an interactive
+ * backend.
+ * ----------------
+ */
+#undef EXEC_DEBUGINTERACTIVE
+
+/* ----------------
+ * EXEC_DEBUGVARIABLEFILE is string, which if defined will
+ * be loaded when the executor is initialized. If this
+ * string is not defined then nothing will be loaded..
+ *
+ * Example:
+ *
+ * #define EXEC_DEBUGVARIABLEFILE "/a/postgres/cimarron/.pg_debugvars"
+ #
+ * Note: since these variables are read at execution time,
+ * they can't affect the first query.. this hack should be
+ * replaced by something better sometime. -cim 11/2/89
+ * ----------------
+ */
+#undef EXEC_DEBUGVARIABLEFILE
+
+/* ----------------------------------------------------------------
+ * #defines controlled by above definitions
+ *
+ * Note: most of these are "incomplete" because I didn't
+ * need the ones not defined. More should be added
+ * only as necessary -cim 10/26/89
+ * ----------------------------------------------------------------
+ */
+#define T_OR_F(b) (b ? "true" : "false")
+#define NULL_OR_TUPLE(slot) (TupIsNull(slot) ? "null" : "a tuple")
+
+
+/* #define EXEC_TUPLECOUNT - XXX take out for now for executor stubbing -- jolly*/
+/* ----------------
+ * tuple count debugging defines
+ * ----------------
+ */
+#ifdef EXEC_TUPLECOUNT
+extern int NTupleProcessed;
+extern int NTupleRetrieved;
+extern int NTupleReplaced;
+extern int NTupleAppended;
+extern int NTupleDeleted;
+extern int NIndexTupleProcessed;
+extern int NIndexTupleInserted;
+
+#define IncrRetrieved() NTupleRetrieved++
+#define IncrAppended() NTupleAppended++
+#define IncrDeleted() NTupleDeleted++
+#define IncrReplaced() NTupleReplaced++
+#define IncrInserted() NTupleInserted++
+#define IncrProcessed() NTupleProcessed++
+#define IncrIndexProcessed() NIndexTupleProcessed++
+#define IncrIndexInserted() NIndexTupleInserted++
+#else
+#define IncrRetrieved()
+#define IncrAppended()
+#define IncrDeleted()
+#define IncrReplaced()
+#define IncrInserted()
+#define IncrProcessed()
+#define IncrIndexProcessed()
+#define IncrIndexInserted()
+#endif /* EXEC_TUPLECOUNT */
+
+/* ----------------
+ * memory context debugging defines
+ * ----------------
+ */
+#ifdef EXEC_CONTEXTDEBUG
+#define CXT_printf(s) printf(s)
+#define CXT1_printf(s, a) printf(s, a)
+#else
+#define CXT_printf(s)
+#define CXT1_printf(s, a)
+#endif /* EXEC_CONTEXTDEBUG */
+
+/* ----------------
+ * eutils debugging defines
+ * ----------------
+ */
+#ifdef EXEC_UTILSDEBUG
+#define EU_nodeDisplay(l) nodeDisplay(l, 0)
+#define EU_printf(s) printf(s)
+#define EU1_printf(s, a) printf(s, a)
+#define EU4_printf(s, a, b, c, d) printf(s, a, b, c, d)
+#else
+#define EU_nodeDisplay(l)
+#define EU_printf(s)
+#define EU1_printf(s, a)
+#define EU4_printf(s, a, b, c, d)
+#endif /* EXEC_UTILSDEBUG */
+
+
+/* ----------------
+ * nest loop debugging defines
+ * ----------------
+ */
+#ifdef EXEC_NESTLOOPDEBUG
+#define NL_nodeDisplay(l) nodeDisplay(l, 0)
+#define NL_printf(s) printf(s)
+#define NL1_printf(s, a) printf(s, a)
+#define NL4_printf(s, a, b, c, d) printf(s, a, b, c, d)
+#define ENL1_printf(message) printf("ExecNestLoop: %s\n", message)
+#else
+#define NL_nodeDisplay(l)
+#define NL_printf(s)
+#define NL1_printf(s, a)
+#define NL4_printf(s, a, b, c, d)
+#define ENL1_printf(message)
+#endif /* EXEC_NESTLOOPDEBUG */
+
+/* ----------------
+ * proc node debugging defines
+ * ----------------
+ */
+#ifdef EXEC_PROCDEBUG
+#define PN_printf(s) printf(s)
+#define PN1_printf(s, p) printf(s, p)
+#else
+#define PN_printf(s)
+#define PN1_printf(s, p)
+#endif /* EXEC_PROCDEBUG */
+
+/* ----------------
+ * exec eval / target list debugging defines
+ * ----------------
+ */
+#ifdef EXEC_EVALDEBUG
+#define EV_nodeDisplay(l) nodeDisplay(l, 0)
+#define EV_printf(s) printf(s)
+#define EV1_printf(s, a) printf(s, a)
+#define EV5_printf(s, a, b, c, d, e) printf(s, a, b, c, d, e)
+#else
+#define EV_nodeDisplay(l)
+#define EV_printf(s)
+#define EV1_printf(s, a)
+#define EV5_printf(s, a, b, c, d, e)
+#endif /* EXEC_EVALDEBUG */
+
+/* ----------------
+ * scan debugging defines
+ * ----------------
+ */
+#ifdef EXEC_SCANDEBUG
+#define S_nodeDisplay(l) nodeDisplay(l, 0)
+#define S_printf(s) printf(s)
+#define S1_printf(s, p) printf(s, p)
+#else
+#define S_nodeDisplay(l)
+#define S_printf(s)
+#define S1_printf(s, p)
+#endif /* EXEC_SCANDEBUG */
+
+/* ----------------
+ * sort node debugging defines
+ * ----------------
+ */
+#ifdef EXEC_SORTDEBUG
+#define SO_nodeDisplay(l) nodeDisplay(l, 0)
+#define SO_printf(s) printf(s)
+#define SO1_printf(s, p) printf(s, p)
+#else
+#define SO_nodeDisplay(l)
+#define SO_printf(s)
+#define SO1_printf(s, p)
+#endif /* EXEC_SORTDEBUG */
+
+/* ----------------
+ * merge join debugging defines
+ * ----------------
+ */
+#ifdef EXEC_MERGEJOINDEBUG
+#define MJ_nodeDisplay(l) nodeDisplay(l, 0)
+#define MJ_printf(s) printf(s)
+#define MJ1_printf(s, p) printf(s, p)
+#define MJ2_printf(s, p1, p2) printf(s, p1, p2)
+#define MJ_debugtup(tuple, type) debugtup(tuple, type)
+#define MJ_dump(context, state) ExecMergeTupleDump(econtext, state)
+#define MJ_DEBUG_QUAL(clause, res) \
+ MJ2_printf(" ExecQual(%s, econtext) returns %s\n", \
+ CppAsString(clause), T_OR_F(res));
+
+#define MJ_DEBUG_MERGE_COMPARE(qual, res) \
+ MJ2_printf(" MergeCompare(mergeclauses, %s, ..) returns %s\n", \
+ CppAsString(qual), T_OR_F(res));
+
+#define MJ_DEBUG_PROC_NODE(slot) \
+ MJ2_printf(" %s = ExecProcNode(innerPlan) returns %s\n", \
+ CppAsString(slot), NULL_OR_TUPLE(slot));
+#else
+#define MJ_nodeDisplay(l)
+#define MJ_printf(s)
+#define MJ1_printf(s, p)
+#define MJ2_printf(s, p1, p2)
+#define MJ_debugtup(tuple, type)
+#define MJ_dump(context, state)
+#define MJ_DEBUG_QUAL(clause, res)
+#define MJ_DEBUG_MERGE_COMPARE(qual, res)
+#define MJ_DEBUG_PROC_NODE(slot)
+#endif /* EXEC_MERGEJOINDEBUG */
+
+/* ----------------------------------------------------------------
+ * DO NOT DEFINE THESE EVER OR YOU WILL BURN!
+ * ----------------------------------------------------------------
+ */
+/* ----------------
+ * DOESNOTWORK is currently placed around memory manager
+ * code that is known to cause problems. Code in between
+ * is likely not converted and probably won't work anyways.
+ * ----------------
+ */
+#undef DOESNOTWORK
+
+/* ----------------
+ * PERHAPSNEVER is placed around the "scan attribute"
+ * support code for the rule manager because for now we
+ * do things inefficiently. The correct solution to our
+ * problem is to add code to the parser/planner to save
+ * attribute information for the rule manager rather than
+ * have the executor have to grope through the entire plan
+ * for it so if we ever decide to make things better,
+ * we should probably delete the stuff in between PERHAPSNEVER..
+ * ----------------
+ */
+#undef PERHAPSNEVER
+
+/* ----------------
+ * NOTYET is placed around any code not yet implemented
+ * in the executor. Only remove these when actually implementing
+ * said code.
+ * ----------------
+ */
+#undef NOTYET
+
+extern long NDirectFileRead;
+extern long NDirectFileWrite;
+
+#endif /* ExecDebugIncluded */
diff --git a/src/include/executor/execdefs.h b/src/include/executor/execdefs.h
new file mode 100644
index 00000000000..2d6db792d8d
--- /dev/null
+++ b/src/include/executor/execdefs.h
@@ -0,0 +1,47 @@
+/*-------------------------------------------------------------------------
+ *
+ * execdefs.h--
+ *
+ *
+ *
+ * Copyright (c) 1994, Regents of the University of California
+ *
+ * $Id: execdefs.h,v 1.1 1996/08/28 07:22:07 scrappy Exp $
+ *
+ *-------------------------------------------------------------------------
+ */
+#ifndef EXECDEFS_H
+#define EXECDEFS_H
+
+/* ----------------
+ * ExecutePlan() tuplecount definitions
+ * ----------------
+ */
+#define ALL_TUPLES 0 /* return all tuples */
+#define ONE_TUPLE 1 /* return only one tuple */
+
+/* ----------------
+ * constants used by ExecMain
+ * ----------------
+ */
+#define EXEC_RUN 3
+#define EXEC_FOR 4
+#define EXEC_BACK 5
+#define EXEC_RETONE 6
+#define EXEC_RESULT 7
+
+/* ----------------
+ * Merge Join states
+ * ----------------
+ */
+#define EXEC_MJ_INITIALIZE 1
+#define EXEC_MJ_JOINMARK 2
+#define EXEC_MJ_JOINTEST 3
+#define EXEC_MJ_JOINTUPLES 4
+#define EXEC_MJ_NEXTOUTER 5
+#define EXEC_MJ_TESTOUTER 6
+#define EXEC_MJ_NEXTINNER 7
+#define EXEC_MJ_SKIPINNER 8
+#define EXEC_MJ_SKIPOUTER 9
+
+#endif /* EXECDEFS_H */
diff --git a/src/include/executor/execdesc.h b/src/include/executor/execdesc.h
new file mode 100644
index 00000000000..b2581efed03
--- /dev/null
+++ b/src/include/executor/execdesc.h
@@ -0,0 +1,38 @@
+/*-------------------------------------------------------------------------
+ *
+ * execdesc.h--
+ * plan and query descriptor accessor macros used by the executor
+ * and related modules.
+ *
+ *
+ * Copyright (c) 1994, Regents of the University of California
+ *
+ * $Id: execdesc.h,v 1.1 1996/08/28 07:22:08 scrappy Exp $
+ *
+ *-------------------------------------------------------------------------
+ */
+#ifndef EXECDESC_H
+#define EXECDESC_H
+
+#include "nodes/parsenodes.h"
+#include "nodes/plannodes.h"
+#include "tcop/dest.h"
+
+/* ----------------
+ * query descriptor:
+ * a QueryDesc encapsulates everything that the executor
+ * needs to execute the query
+ * ---------------------
+ */
+typedef struct QueryDesc {
+ CmdType operation; /* CMD_SELECT, CMD_UPDATE, etc. */
+ Query *parsetree;
+ Plan *plantree;
+ CommandDest dest; /* the destination output of the execution */
+} QueryDesc;
+
+/* in pquery.c */
+extern QueryDesc *CreateQueryDesc(Query *parsetree, Plan *plantree,
+ CommandDest dest);
+
+#endif /* EXECDESC_H */
diff --git a/src/include/executor/executor.h b/src/include/executor/executor.h
new file mode 100644
index 00000000000..e6875c1cd27
--- /dev/null
+++ b/src/include/executor/executor.h
@@ -0,0 +1,229 @@
+/*-------------------------------------------------------------------------
+ *
+ * executor.h--
+ * support for the POSTGRES executor module
+ *
+ *
+ * Copyright (c) 1994, Regents of the University of California
+ *
+ * $Id: executor.h,v 1.1 1996/08/28 07:22:09 scrappy Exp $
+ *
+ *-------------------------------------------------------------------------
+ */
+#ifndef EXECUTOR_H
+#define EXECUTOR_H
+
+/* ----------------------------------------------------------------
+ * #includes
+ * ----------------------------------------------------------------
+ */
+#include <stdio.h>
+#include <string.h>
+
+#include "postgres.h"
+#include "nodes/pg_list.h"
+
+/* ----------------
+ * executor debugging definitions are kept in a separate file
+ * so people can customize what debugging they want to see and not
+ * have this information clobbered every time a new version of
+ * executor.h is checked in -cim 10/26/89
+ * ----------------
+ */
+#include "executor/execdebug.h"
+
+#include "access/heapam.h"
+#include "access/htup.h"
+#include "access/istrat.h"
+#include "access/itup.h"
+#include "access/skey.h"
+#include "utils/tqual.h"
+#include "catalog/catname.h"
+#include "utils/syscache.h"
+#include "executor/execdefs.h"
+#include "executor/tuptable.h"
+
+#include "nodes/parsenodes.h"
+
+#include "storage/buf.h"
+#include "miscadmin.h"
+#include "fmgr.h"
+#include "utils/elog.h"
+#include "utils/mcxt.h"
+#include "utils/memutils.h"
+#include "utils/rel.h"
+
+#include "catalog/pg_index.h"
+#include "catalog/pg_proc.h"
+#include "catalog/pg_type.h"
+#include "catalog/pg_aggregate.h"
+
+#include "access/printtup.h"
+#include "nodes/primnodes.h"
+#include "nodes/plannodes.h"
+#include "nodes/execnodes.h"
+
+#include "tcop/dest.h"
+#include "storage/smgr.h"
+
+#include "access/genam.h"
+#include "executor/execdesc.h"
+
+/*
+ * prototypes from functions in execAmi.c
+ */
+extern void ExecOpenScanR(Oid relOid, int nkeys, ScanKey skeys, bool isindex,
+ ScanDirection dir, TimeQual timeRange,
+ Relation *returnRelation, Pointer *returnScanDesc);
+extern Relation ExecOpenR(Oid relationOid, bool isindex);
+extern Pointer ExecBeginScan(Relation relation, int nkeys, ScanKey skeys,
+ bool isindex, ScanDirection dir, TimeQual time_range);
+extern void ExecCloseR(Plan *node);
+extern void ExecReScan(Plan *node, ExprContext *exprCtxt, Plan *parent);
+extern HeapScanDesc ExecReScanR(Relation relDesc, HeapScanDesc scanDesc,
+ ScanDirection direction, int nkeys, ScanKey skeys);
+extern void ExecMarkPos(Plan *node);
+extern void ExecRestrPos(Plan *node);
+extern Relation ExecCreatR(TupleDesc tupType, Oid relationOid);
+
+/*
+ * prototypes from functions in execJunk.c
+ */
+extern JunkFilter *ExecInitJunkFilter(List *targetList);
+extern bool ExecGetJunkAttribute(JunkFilter *junkfilter, TupleTableSlot *slot,
+ char *attrName, Datum *value, bool *isNull);
+extern HeapTuple ExecRemoveJunk(JunkFilter *junkfilter, TupleTableSlot *slot);
+
+
+/*
+ * prototypes from functions in execMain.c
+ */
+extern TupleDesc ExecutorStart(QueryDesc *queryDesc, EState *estate);
+extern TupleTableSlot* ExecutorRun(QueryDesc *queryDesc, EState *estate, int feature, int count);
+extern void ExecutorEnd(QueryDesc *queryDesc, EState *estate);
+
+/*
+ * prototypes from functions in execProcnode.c
+ */
+extern bool ExecInitNode(Plan *node, EState *estate, Plan *parent);
+extern TupleTableSlot *ExecProcNode(Plan *node, Plan *parent);
+extern int ExecCountSlotsNode(Plan *node);
+extern void ExecEndNode(Plan *node, Plan *parent);
+
+/*
+ * prototypes from functions in execQual.c
+ */
+extern bool execConstByVal;
+extern int execConstLen;
+
+extern Datum ExecExtractResult(TupleTableSlot *slot, AttrNumber attnum,
+ bool *isNull);
+extern Datum ExecEvalVar(Var *variable, ExprContext *econtext, bool *isNull);
+extern Datum ExecEvalParam(Param *expression, ExprContext *econtext,
+ bool *isNull);
+extern char *GetAttributeByNum(TupleTableSlot *slot, AttrNumber attrno,
+ bool *isNull);
+extern char *att_by_num(TupleTableSlot *slot, AttrNumber attrno,
+ bool *isNull);
+/* stop here */
+extern char *GetAttributeByName(TupleTableSlot *slot, char *attname,
+ bool *isNull);
+extern char *att_by_name(TupleTableSlot *slot, char *attname, bool *isNull);
+extern void ExecEvalFuncArgs(FunctionCachePtr fcache, ExprContext *econtext,
+ List *argList, Datum argV[], bool *argIsDone);
+extern Datum ExecMakeFunctionResult(Node *node, List *arguments,
+ ExprContext *econtext, bool *isNull, bool *isDone);
+extern Datum ExecEvalOper(Expr *opClause, ExprContext *econtext,
+ bool *isNull);
+extern Datum ExecEvalFunc(Expr *funcClause, ExprContext *econtext,
+ bool *isNull, bool *isDone);
+extern Datum ExecEvalNot(Expr *notclause, ExprContext *econtext, bool *isNull);
+extern Datum ExecEvalOr(Expr *orExpr, ExprContext *econtext, bool *isNull);
+extern Datum ExecEvalAnd(Expr *andExpr, ExprContext *econtext, bool *isNull);
+extern Datum ExecEvalExpr(Node *expression, ExprContext *econtext, bool *isNull,
+ bool *isDone);
+extern bool ExecQualClause(Node *clause, ExprContext *econtext);
+extern bool ExecQual(List *qual, ExprContext *econtext);
+extern int ExecTargetListLength(List *targetlist);
+extern TupleTableSlot *ExecProject(ProjectionInfo *projInfo, bool *isDone);
+
+/*
+ * prototypes from functions in execScan.c
+ */
+extern TupleTableSlot *ExecScan(Scan *node, TupleTableSlot* (*accessMtd)());
+
+/*
+ * prototypes from functions in execTuples.c
+ */
+extern TupleTable ExecCreateTupleTable(int initialSize);
+extern void ExecDestroyTupleTable(TupleTable table, bool shouldFree);
+extern TupleTableSlot* ExecAllocTableSlot(TupleTable table);
+extern TupleTableSlot* ExecStoreTuple(HeapTuple tuple,
+ TupleTableSlot *slot,
+ Buffer buffer,
+ bool shouldFree);
+extern TupleTableSlot* ExecClearTuple(TupleTableSlot* slot);
+extern bool ExecSlotPolicy(TupleTableSlot *slot);
+extern bool ExecSetSlotPolicy(TupleTableSlot *slot, bool shouldFree);
+extern TupleDesc ExecSetSlotDescriptor(TupleTableSlot *slot,
+ TupleDesc tupdesc);
+extern void ExecSetSlotDescriptorIsNew(TupleTableSlot *slot, bool isNew);
+extern TupleDesc ExecSetNewSlotDescriptor(TupleTableSlot *slot,
+ TupleDesc tupdesc);
+extern Buffer ExecSetSlotBuffer(TupleTableSlot *slot, Buffer b);
+extern void ExecIncrSlotBufferRefcnt(TupleTableSlot *slot);
+extern bool TupIsNull(TupleTableSlot* slot);
+extern bool ExecSlotDescriptorIsNew(TupleTableSlot *slot);
+extern void ExecInitResultTupleSlot(EState *estate, CommonState *commonstate);
+extern void ExecInitScanTupleSlot(EState *estate,
+ CommonScanState *commonscanstate);
+extern void ExecInitMarkedTupleSlot(EState *estate, MergeJoinState *mergestate);
+extern void ExecInitOuterTupleSlot(EState *estate, HashJoinState *hashstate);
+extern void ExecInitHashTupleSlot(EState *estate, HashJoinState *hashstate);
+extern TupleTableSlot *NodeGetResultTupleSlot(Plan *node);
+
+extern TupleDesc ExecGetTupType(Plan *node);
+extern TupleDesc ExecTypeFromTL(List *targetList);
+
+/*
+ * prototypes from functions in execTuples.c
+ */
+extern void ResetTupleCount();
+extern void DisplayTupleCount(FILE *statfp);
+extern void ExecAssignNodeBaseInfo(EState *estate, CommonState *basenode,
+ Plan *parent);
+extern void ExecAssignExprContext(EState *estate, CommonState *commonstate);
+extern void ExecAssignResultType(CommonState *commonstate,
+ TupleDesc tupDesc);
+extern void ExecAssignResultTypeFromOuterPlan(Plan *node,
+ CommonState *commonstate);
+extern void ExecAssignResultTypeFromTL(Plan *node, CommonState *commonstate);
+extern TupleDesc ExecGetResultType(CommonState *commonstate);
+extern void ExecFreeResultType(CommonState *commonstate);
+extern void ExecAssignProjectionInfo(Plan *node, CommonState *commonstate);
+extern void ExecFreeProjectionInfo(CommonState *commonstate);
+extern TupleDesc ExecGetScanType(CommonScanState *csstate);
+extern void ExecFreeScanType(CommonScanState *csstate);
+extern void ExecAssignScanType(CommonScanState *csstate,
+ TupleDesc tupDesc);
+extern void ExecAssignScanTypeFromOuterPlan(Plan *node,
+ CommonScanState *csstate);
+extern AttributeTupleForm ExecGetTypeInfo(Relation relDesc);
+
+extern void ExecGetIndexKeyInfo(IndexTupleForm indexTuple, int *numAttsOutP,
+ AttrNumber **attsOutP, FuncIndexInfoPtr fInfoP);
+extern void ExecOpenIndices(Oid resultRelationOid,
+ RelationInfo *resultRelationInfo);
+extern void ExecCloseIndices(RelationInfo *resultRelationInfo);
+extern IndexTuple ExecFormIndexTuple(HeapTuple heapTuple,
+ Relation heapRelation, Relation indexRelation, IndexInfo *indexInfo);
+extern void ExecInsertIndexTuples(TupleTableSlot *slot, ItemPointer tupleid,
+ EState *estate);
+
+
+/* ----------------------------------------------------------------
+ * the end
+ * ----------------------------------------------------------------
+ */
+
+#endif /* EXECUTOR_H */
diff --git a/src/include/executor/functions.h b/src/include/executor/functions.h
new file mode 100644
index 00000000000..e404b0cbe42
--- /dev/null
+++ b/src/include/executor/functions.h
@@ -0,0 +1,22 @@
+/*-------------------------------------------------------------------------
+ *
+ * functions.h--
+ *
+ *
+ *
+ * Copyright (c) 1994, Regents of the University of California
+ *
+ * $Id: functions.h,v 1.1 1996/08/28 07:22:12 scrappy Exp $
+ *
+ *-------------------------------------------------------------------------
+ */
+#ifndef FUNCTIONS_H
+#define FUNCTIONS_H
+
+extern Datum ProjectAttribute(TupleDesc TD, TargetEntry *tlist,
+ HeapTuple tup, bool *isnullP);
+
+extern Datum postquel_function(Func *funcNode, char **args,
+ bool *isNull, bool *isDone);
+
+#endif /* FUNCTIONS_H */
diff --git a/src/include/executor/hashjoin.h b/src/include/executor/hashjoin.h
new file mode 100644
index 00000000000..4e3dcc81c0a
--- /dev/null
+++ b/src/include/executor/hashjoin.h
@@ -0,0 +1,82 @@
+/*-------------------------------------------------------------------------
+ *
+ * hashjoin.h--
+ * internal structures for hash table and buckets
+ *
+ *
+ * Copyright (c) 1994, Regents of the University of California
+ *
+ * $Id: hashjoin.h,v 1.1 1996/08/28 07:22:13 scrappy Exp $
+ *
+ *-------------------------------------------------------------------------
+ */
+#ifndef HASHJOIN_H
+#define HASHJOIN_H
+
+#include "access/htup.h"
+#include "storage/ipc.h"
+
+/* -----------------
+ * have to use relative address as pointers in the hashtable
+ * because the hashtable may reallocate in difference processes
+ * -----------------
+ */
+typedef int RelativeAddr;
+
+/* ------------------
+ * the relative addresses are always relative to the head of the
+ * hashtable, the following macro converts them to absolute address.
+ * ------------------
+ */
+#define ABSADDR(X) ((X) < 0 ? NULL: (char*)hashtable + X)
+#define RELADDR(X) (RelativeAddr)((char*)(X) - (char*)hashtable)
+
+typedef char **charPP;
+typedef int *intP;
+
+/* ----------------------------------------------------------------
+ * hash-join hash table structures
+ * ----------------------------------------------------------------
+ */
+typedef struct HashTableData {
+ int nbuckets;
+ int totalbuckets;
+ int bucketsize;
+ IpcMemoryId shmid;
+ RelativeAddr top; /* char* */
+ RelativeAddr bottom; /* char* */
+ RelativeAddr overflownext; /* char* */
+ RelativeAddr batch; /* char* */
+ RelativeAddr readbuf; /* char* */
+ int nbatch;
+ RelativeAddr outerbatchNames; /* RelativeAddr* */
+ RelativeAddr outerbatchPos; /* RelativeAddr* */
+ RelativeAddr innerbatchNames; /* RelativeAddr* */
+ RelativeAddr innerbatchPos; /* RelativeAddr* */
+ RelativeAddr innerbatchSizes; /* int* */
+ int curbatch;
+ int nprocess;
+ int pcount;
+} HashTableData; /* real hash table follows here */
+
+typedef HashTableData *HashJoinTable;
+
+typedef struct OverflowTupleData {
+ RelativeAddr tuple; /* HeapTuple */
+ RelativeAddr next; /* struct OverflowTupleData * */
+} OverflowTupleData; /* real tuple follows here */
+
+typedef OverflowTupleData *OverflowTuple;
+
+typedef struct HashBucketData {
+ RelativeAddr top; /* HeapTuple */
+ RelativeAddr bottom; /* HeapTuple */
+ RelativeAddr firstotuple; /* OverflowTuple */
+ RelativeAddr lastotuple; /* OverflowTuple */
+} HashBucketData; /* real bucket follows here */
+
+typedef HashBucketData *HashBucket;
+
+#define HASH_PERMISSION 0700
+
+#endif /* HASHJOIN_H */
diff --git a/src/include/executor/nodeAgg.h b/src/include/executor/nodeAgg.h
new file mode 100644
index 00000000000..9c46a03e207
--- /dev/null
+++ b/src/include/executor/nodeAgg.h
@@ -0,0 +1,21 @@
+/*-------------------------------------------------------------------------
+ *
+ * nodeAgg.h--
+ *
+ *
+ *
+ * Copyright (c) 1994, Regents of the University of California
+ *
+ * $Id: nodeAgg.h,v 1.1 1996/08/28 07:22:14 scrappy Exp $
+ *
+ *-------------------------------------------------------------------------
+ */
+#ifndef NODEAGG_H
+#define NODEAGG_H
+
+extern TupleTableSlot *ExecAgg(Agg *node);
+extern bool ExecInitAgg(Agg *node, EState *estate, Plan *parent);
+extern int ExecCountSlotsAgg(Agg *node);
+extern void ExecEndAgg(Agg *node);
+
+#endif /* NODEAGG_H */
diff --git a/src/include/executor/nodeAppend.h b/src/include/executor/nodeAppend.h
new file mode 100644
index 00000000000..76c6c91a391
--- /dev/null
+++ b/src/include/executor/nodeAppend.h
@@ -0,0 +1,22 @@
+/*-------------------------------------------------------------------------
+ *
+ * nodeAppend.h--
+ *
+ *
+ *
+ * Copyright (c) 1994, Regents of the University of California
+ *
+ * $Id: nodeAppend.h,v 1.1 1996/08/28 07:22:15 scrappy Exp $
+ *
+ *-------------------------------------------------------------------------
+ */
+#ifndef NODEAPPEND_H
+#define NODEAPPEND_H
+
+extern bool exec_append_initialize_next(Append *node);
+extern bool ExecInitAppend(Append *node, EState *estate, Plan *parent);
+extern int ExecCountSlotsAppend(Append *node);
+extern TupleTableSlot *ExecProcAppend(Append *node);
+extern void ExecEndAppend(Append *node);
+
+#endif /* NODEAPPEND_H */
diff --git a/src/include/executor/nodeGroup.h b/src/include/executor/nodeGroup.h
new file mode 100644
index 00000000000..6a6da53ce8e
--- /dev/null
+++ b/src/include/executor/nodeGroup.h
@@ -0,0 +1,21 @@
+/*-------------------------------------------------------------------------
+ *
+ * nodeGroup.h--
+ * prototypes for nodeGroup.c
+ *
+ *
+ * Copyright (c) 1994, Regents of the University of California
+ *
+ * $Id: nodeGroup.h,v 1.1 1996/08/28 07:22:17 scrappy Exp $
+ *
+ *-------------------------------------------------------------------------
+ */
+#ifndef NODEGROUP_H
+#define NODEGROUP_H
+
+extern TupleTableSlot *ExecGroup(Group *node);
+extern bool ExecInitGroup(Group *node, EState *estate, Plan *parent);
+extern int ExecCountSlotsGroup(Group *node);
+extern void ExecEndGroup(Group *node);
+
+#endif /* NODEGROUP_H */
diff --git a/src/include/executor/nodeHash.h b/src/include/executor/nodeHash.h
new file mode 100644
index 00000000000..2427958d145
--- /dev/null
+++ b/src/include/executor/nodeHash.h
@@ -0,0 +1,35 @@
+/*-------------------------------------------------------------------------
+ *
+ * nodeHash.h--
+ *
+ *
+ *
+ * Copyright (c) 1994, Regents of the University of California
+ *
+ * $Id: nodeHash.h,v 1.1 1996/08/28 07:22:18 scrappy Exp $
+ *
+ *-------------------------------------------------------------------------
+ */
+#ifndef NODEHASH_H
+#define NODEHASH_H
+
+extern TupleTableSlot *ExecHash(Hash *node);
+extern bool ExecInitHash(Hash *node, EState *estate, Plan *parent);
+extern int ExecCountSlotsHash(Hash *node);
+extern void ExecEndHash(Hash *node);
+extern RelativeAddr hashTableAlloc(int size, HashJoinTable hashtable);
+extern HashJoinTable ExecHashTableCreate(Hash *node);
+extern void ExecHashTableInsert(HashJoinTable hashtable, ExprContext *econtext,
+ Var *hashkey, File *batches);
+extern void ExecHashTableDestroy(HashJoinTable hashtable);
+extern int ExecHashGetBucket(HashJoinTable hashtable, ExprContext *econtext,
+ Var *hashkey);
+extern void ExecHashOverflowInsert(HashJoinTable hashtable, HashBucket bucket,
+ HeapTuple heapTuple);
+extern HeapTuple ExecScanHashBucket(HashJoinState *hjstate, HashBucket bucket,
+ HeapTuple curtuple, List *hjclauses,
+ ExprContext *econtext);
+extern int ExecHashPartition(Hash *node);
+extern void ExecHashTableReset(HashJoinTable hashtable, int ntuples);
+
+#endif /* NODEHASH_H */
diff --git a/src/include/executor/nodeHashjoin.h b/src/include/executor/nodeHashjoin.h
new file mode 100644
index 00000000000..8930b5b4993
--- /dev/null
+++ b/src/include/executor/nodeHashjoin.h
@@ -0,0 +1,33 @@
+/*-------------------------------------------------------------------------
+ *
+ * nodeHashjoin.h--
+ *
+ *
+ *
+ * Copyright (c) 1994, Regents of the University of California
+ *
+ * $Id: nodeHashjoin.h,v 1.1 1996/08/28 07:22:19 scrappy Exp $
+ *
+ *-------------------------------------------------------------------------
+ */
+#ifndef NODEHASHJOIN_H
+#define NODEHASHJOIN_H
+
+extern TupleTableSlot *ExecHashJoin(HashJoin *node);
+
+extern bool ExecInitHashJoin(HashJoin *node, EState *estate, Plan *parent);
+
+extern int ExecCountSlotsHashJoin(HashJoin *node);
+
+extern void ExecEndHashJoin(HashJoin *node);
+
+extern int ExecHashJoinNewBatch(HashJoinState *hjstate);
+
+extern char *ExecHashJoinSaveTuple(HeapTuple heapTuple, char *buffer,
+ File file, char *position);
+
+extern int ExecHashJoinGetBatch(int bucketno, HashJoinTable hashtable,
+ int nbatch);
+
+
+#endif /* NODEHASHJOIN_H */
diff --git a/src/include/executor/nodeIndexscan.h b/src/include/executor/nodeIndexscan.h
new file mode 100644
index 00000000000..dcb361dc1ac
--- /dev/null
+++ b/src/include/executor/nodeIndexscan.h
@@ -0,0 +1,32 @@
+/*-------------------------------------------------------------------------
+ *
+ * nodeIndexscan.h--
+ *
+ *
+ *
+ * Copyright (c) 1994, Regents of the University of California
+ *
+ * $Id: nodeIndexscan.h,v 1.1 1996/08/28 07:22:20 scrappy Exp $
+ *
+ *-------------------------------------------------------------------------
+ */
+#ifndef NODEINDEXSCAN_H
+#define NODEINDEXSCAN_H
+
+extern TupleTableSlot *ExecIndexScan(IndexScan *node);
+
+extern void ExecIndexReScan(IndexScan *node, ExprContext *exprCtxt, Plan *parent);
+
+extern void ExecEndIndexScan(IndexScan *node);
+
+extern void ExecIndexMarkPos(IndexScan *node);
+
+extern void ExecIndexRestrPos(IndexScan *node);
+
+extern void ExecUpdateIndexScanKeys(IndexScan *node, ExprContext *econtext);
+
+extern bool ExecInitIndexScan(IndexScan *node, EState *estate, Plan *parent);
+
+extern int ExecCountSlotsIndexScan(IndexScan *node);
+
+#endif /* NODEINDEXSCAN_H */
diff --git a/src/include/executor/nodeMaterial.h b/src/include/executor/nodeMaterial.h
new file mode 100644
index 00000000000..3560315c533
--- /dev/null
+++ b/src/include/executor/nodeMaterial.h
@@ -0,0 +1,23 @@
+/*-------------------------------------------------------------------------
+ *
+ * nodeMaterial.h--
+ *
+ *
+ *
+ * Copyright (c) 1994, Regents of the University of California
+ *
+ * $Id: nodeMaterial.h,v 1.1 1996/08/28 07:22:21 scrappy Exp $
+ *
+ *-------------------------------------------------------------------------
+ */
+#ifndef NODEMATERIAL_H
+#define NODEMATERIAL_H
+
+extern TupleTableSlot *ExecMaterial(Material *node);
+extern bool ExecInitMaterial(Material *node, EState *estate, Plan *parent);
+extern int ExecCountSlotsMaterial(Material *node);
+extern void ExecEndMaterial(Material *node);
+extern List ExecMaterialMarkPos(Material *node);
+extern void ExecMaterialRestrPos(Material *node);
+
+#endif /* NODEMATERIAL_H */
diff --git a/src/include/executor/nodeMergejoin.h b/src/include/executor/nodeMergejoin.h
new file mode 100644
index 00000000000..d88cdae8526
--- /dev/null
+++ b/src/include/executor/nodeMergejoin.h
@@ -0,0 +1,40 @@
+/*-------------------------------------------------------------------------
+ *
+ * nodeMergejoin.h--
+ *
+ *
+ *
+ * Copyright (c) 1994, Regents of the University of California
+ *
+ * $Id: nodeMergejoin.h,v 1.1 1996/08/28 07:22:22 scrappy Exp $
+ *
+ *-------------------------------------------------------------------------
+ */
+#ifndef NODEMERGEJOIN_H
+#define NODEMERGEJOIN_H
+
+#if 0 /* aren't these static? */
+extern List MJFormOSortopI(List qualList, Oid sortOp);
+extern List MJFormISortopO(List qualList, Oid sortOp);
+#endif
+extern bool MergeCompare(List *eqQual, List *compareQual, ExprContext *econtext);
+
+extern void ExecMergeTupleDumpInner(ExprContext *econtext);
+
+extern void ExecMergeTupleDumpOuter(ExprContext *econtext);
+
+extern void ExecMergeTupleDumpMarked(ExprContext *econtext,
+ MergeJoinState *mergestate);
+
+extern void ExecMergeTupleDump(ExprContext *econtext,
+ MergeJoinState *mergestate);
+
+extern TupleTableSlot *ExecMergeJoin(MergeJoin *node);
+
+extern bool ExecInitMergeJoin(MergeJoin *node, EState *estate, Plan *parent);
+
+extern int ExecCountSlotsMergeJoin(MergeJoin *node);
+
+extern void ExecEndMergeJoin(MergeJoin *node);
+
+#endif /* NODEMERGEJOIN_H; */
diff --git a/src/include/executor/nodeNestloop.h b/src/include/executor/nodeNestloop.h
new file mode 100644
index 00000000000..1fe271c0702
--- /dev/null
+++ b/src/include/executor/nodeNestloop.h
@@ -0,0 +1,21 @@
+/*-------------------------------------------------------------------------
+ *
+ * nodeNestloop.h--
+ *
+ *
+ *
+ * Copyright (c) 1994, Regents of the University of California
+ *
+ * $Id: nodeNestloop.h,v 1.1 1996/08/28 07:22:23 scrappy Exp $
+ *
+ *-------------------------------------------------------------------------
+ */
+#ifndef NODENESTLOOP_H
+#define NODENESTLOOP_H
+
+extern TupleTableSlot *ExecNestLoop(NestLoop *node, Plan *parent);
+extern bool ExecInitNestLoop(NestLoop *node, EState *estate, Plan *parent);
+extern int ExecCountSlotsNestLoop(NestLoop *node);
+extern void ExecEndNestLoop(NestLoop *node);
+
+#endif /* NODENESTLOOP_H */
diff --git a/src/include/executor/nodeResult.h b/src/include/executor/nodeResult.h
new file mode 100644
index 00000000000..ba100ffa54c
--- /dev/null
+++ b/src/include/executor/nodeResult.h
@@ -0,0 +1,21 @@
+/*-------------------------------------------------------------------------
+ *
+ * nodeResult.h--
+ *
+ *
+ *
+ * Copyright (c) 1994, Regents of the University of California
+ *
+ * $Id: nodeResult.h,v 1.1 1996/08/28 07:22:24 scrappy Exp $
+ *
+ *-------------------------------------------------------------------------
+ */
+#ifndef NODERESULT_H
+#define NODERESULT_H
+
+extern TupleTableSlot *ExecResult(Result *node);
+extern bool ExecInitResult(Result *node, EState *estate, Plan *parent);
+extern int ExecCountSlotsResult(Result *node);
+extern void ExecEndResult(Result *node);
+
+#endif /* NODERESULT_H */
diff --git a/src/include/executor/nodeSeqscan.h b/src/include/executor/nodeSeqscan.h
new file mode 100644
index 00000000000..166037f8c4d
--- /dev/null
+++ b/src/include/executor/nodeSeqscan.h
@@ -0,0 +1,27 @@
+/*-------------------------------------------------------------------------
+ *
+ * nodeSeqscan.h--
+ *
+ *
+ *
+ * Copyright (c) 1994, Regents of the University of California
+ *
+ * $Id: nodeSeqscan.h,v 1.1 1996/08/28 07:22:24 scrappy Exp $
+ *
+ *-------------------------------------------------------------------------
+ */
+#ifndef NODESEQSCAN_H
+#define NODESEQSCAN_H
+
+extern TupleTableSlot *SeqNext(SeqScan *node);
+extern TupleTableSlot *ExecSeqScan(SeqScan *node);
+extern Oid InitScanRelation(SeqScan *node, EState *estate,
+ CommonScanState *scanstate, Plan *outerPlan);
+extern bool ExecInitSeqScan(SeqScan *node, EState *estate, Plan *parent);
+extern int ExecCountSlotsSeqScan(SeqScan *node);
+extern void ExecEndSeqScan(SeqScan *node);
+extern void ExecSeqReScan(SeqScan *node, ExprContext *exprCtxt, Plan* parent);
+extern void ExecSeqMarkPos(SeqScan *node);
+extern void ExecSeqRestrPos(SeqScan *node);
+
+#endif /* NODESEQSCAN_H */
diff --git a/src/include/executor/nodeSort.h b/src/include/executor/nodeSort.h
new file mode 100644
index 00000000000..a95d9dc0522
--- /dev/null
+++ b/src/include/executor/nodeSort.h
@@ -0,0 +1,23 @@
+/*-------------------------------------------------------------------------
+ *
+ * nodeSort.h--
+ *
+ *
+ *
+ * Copyright (c) 1994, Regents of the University of California
+ *
+ * $Id: nodeSort.h,v 1.1 1996/08/28 07:22:25 scrappy Exp $
+ *
+ *-------------------------------------------------------------------------
+ */
+#ifndef NODESORT_H
+#define NODESORT_H
+
+extern TupleTableSlot *ExecSort(Sort *node);
+extern bool ExecInitSort(Sort *node, EState *estate, Plan *parent);
+extern int ExecCountSlotsSort(Sort *node);
+extern void ExecEndSort(Sort *node);
+extern void ExecSortMarkPos(Sort *node);
+extern void ExecSortRestrPos(Sort *node);
+
+#endif /* NODESORT_H */
diff --git a/src/include/executor/nodeTee.h b/src/include/executor/nodeTee.h
new file mode 100644
index 00000000000..d70a5984698
--- /dev/null
+++ b/src/include/executor/nodeTee.h
@@ -0,0 +1,22 @@
+/*-------------------------------------------------------------------------
+ *
+ * nodeTee.h--
+ * support functions for a Tee executor node
+ *
+ * Copyright (c) 1994, Regents of the University of California
+ *
+ * $Id: nodeTee.h,v 1.1 1996/08/28 07:22:26 scrappy Exp $
+ *
+ *-------------------------------------------------------------------------
+ */
+
+#ifndef NODETEE_H
+#define NODETEE_H
+
+extern TupleTableSlot* ExecTee(Tee* node, Plan* parent);
+extern bool ExecInitTee(Tee* node, EState* estate, Plan* parent);
+extern void ExecTeeReScan(Tee *node, ExprContext *exprCtxt, Plan *parent);
+extern void ExecEndTee(Tee* node, Plan* parent);
+extern int ExecCountSlotsTee(Tee* node);
+
+#endif /* NODETEE_H */
diff --git a/src/include/executor/nodeUnique.h b/src/include/executor/nodeUnique.h
new file mode 100644
index 00000000000..a3c143e3459
--- /dev/null
+++ b/src/include/executor/nodeUnique.h
@@ -0,0 +1,21 @@
+/*-------------------------------------------------------------------------
+ *
+ * nodeUnique.h--
+ *
+ *
+ *
+ * Copyright (c) 1994, Regents of the University of California
+ *
+ * $Id: nodeUnique.h,v 1.1 1996/08/28 07:22:27 scrappy Exp $
+ *
+ *-------------------------------------------------------------------------
+ */
+#ifndef NODEUNIQUE_H
+#define NODEUNIQUE_H
+
+extern TupleTableSlot *ExecUnique(Unique *node);
+extern bool ExecInitUnique(Unique *node, EState *estate, Plan *parent);
+extern int ExecCountSlotsUnique(Unique *node);
+extern void ExecEndUnique(Unique *node);
+
+#endif /* NODEUNIQUE_H */
diff --git a/src/include/executor/tuptable.h b/src/include/executor/tuptable.h
new file mode 100644
index 00000000000..cb60093565e
--- /dev/null
+++ b/src/include/executor/tuptable.h
@@ -0,0 +1,72 @@
+/*-------------------------------------------------------------------------
+ *
+ * tuptable.h--
+ * tuple table support stuff
+ *
+ *
+ * Copyright (c) 1994, Regents of the University of California
+ *
+ * $Id: tuptable.h,v 1.1 1996/08/28 07:22:28 scrappy Exp $
+ *
+ * NOTES
+ * The tuple table interface is getting pretty ugly.
+ * It should be redesigned soon.
+ *
+ *-------------------------------------------------------------------------
+ */
+#ifndef TUPTABLE_H
+#define TUPTABLE_H
+
+/* ----------------
+ * Note: the executor tuple table is managed and manipulated by special
+ * code and macros in executor/execTuples.c and tupTable.h
+ *
+ * TupleTableSlot information
+ *
+ * shouldFree boolean - should we call pfree() on tuple
+ * descIsNew boolean - true when tupleDescriptor changes
+ * tupleDescriptor type information kept regarding the tuple data
+ * buffer the buffer for tuples pointing to disk pages
+ *
+ * The executor stores pointers to tuples in a ``tuple table''
+ * which is composed of TupleTableSlot's. Some of the tuples
+ * are pointers to buffer pages and others are pointers to
+ * palloc'ed memory and the shouldFree variable tells us when
+ * we may call pfree() on a tuple. -cim 9/23/90
+ *
+ * In the implementation of nested-dot queries such as
+ * "retrieve (EMP.hobbies.all)", a single scan may return tuples
+ * of many types, so now we return pointers to tuple descriptors
+ * along with tuples returned via the tuple table. -cim 1/18/90
+ * ----------------
+ */
+typedef struct TupleTableSlot {
+ NodeTag type;
+ HeapTuple val;
+ bool ttc_shouldFree;
+ bool ttc_descIsNew;
+ TupleDesc ttc_tupleDescriptor;
+ Buffer ttc_buffer;
+ int ttc_whichplan;
+} TupleTableSlot;
+
+/* ----------------
+ * tuple table data structure
+ * ----------------
+ */
+typedef struct TupleTableData {
+ int size; /* size of the table */
+ int next; /* next available slot number */
+ TupleTableSlot *array; /* array of TupleTableSlot's */
+} TupleTableData;
+
+typedef TupleTableData *TupleTable;
+
+/*
+ tuple table macros are all excised from the system now
+ see executor.h for decls of functions defined in execTuples.c
+
+ - jolly
+*/
+
+#endif /* TUPTABLE_H */