diff options
Diffstat (limited to 'src/include/executor')
29 files changed, 0 insertions, 1474 deletions
diff --git a/src/include/executor/execdebug.h b/src/include/executor/execdebug.h deleted file mode 100644 index a01c60ccc1e..00000000000 --- a/src/include/executor/execdebug.h +++ /dev/null @@ -1,301 +0,0 @@ -/*------------------------------------------------------------------------- - * - * execdebug.h - * #defines governing debugging behaviour in the executor - * - * - * Portions Copyright (c) 1996-2002, PostgreSQL Global Development Group - * Portions Copyright (c) 1994, Regents of the University of California - * - * $Id: execdebug.h,v 1.20 2002/06/20 20:29:49 momjian Exp $ - * - *------------------------------------------------------------------------- - */ -#ifndef EXECDEBUG_H -#define EXECDEBUG_H - -#include "executor/executor.h" -#include "nodes/print.h" - -/* ---------------------------------------------------------------- - * debugging defines. - * - * If you want certain debugging behaviour, then #define - * the variable to 1. No need to explicitly #undef by default, - * since we can use -D compiler options to enable features. - * - thomas 1999-02-20 - * ---------------------------------------------------------------- - */ - -/* ---------------- - * 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_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_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 - */ - -/* ---------------------------------------------------------------- - * #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") - - -/* ---------------- - * 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 -/* stop compiler warnings */ -#define IncrRetrieved() (void)(0) -#define IncrAppended() (void)(0) -#define IncrDeleted() (void)(0) -#define IncrReplaced() (void)(0) -#define IncrInserted() (void)(0) -#define IncrProcessed() (void)(0) -#define IncrIndexProcessed() (void)(0) -#define IncrIndexInserted() (void)(0) -#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) -#define EU_printf(s) printf(s) -#define EU1_printf(s, a) printf(s, a) -#define EU2_printf(s, a, b) printf(s, a, b) -#define EU3_printf(s, a, b, c) printf(s, a, b, c) -#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 EU2_printf(s, a, b) -#define EU3_printf(s, a, b, c) -#define EU4_printf(s, a, b, c, d) -#endif /* EXEC_UTILSDEBUG */ - - -/* ---------------- - * nest loop debugging defines - * ---------------- - */ -#ifdef EXEC_NESTLOOPDEBUG -#define NL_nodeDisplay(l) nodeDisplay(l) -#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) -#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) -#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) -#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) -#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, NULL) -#define MJ_dump(state) ExecMergeTupleDump(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(...) 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(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! - * ---------------------------------------------------------------- - */ -/* ---------------- - * 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 deleted file mode 100644 index 4cfd4c435e8..00000000000 --- a/src/include/executor/execdefs.h +++ /dev/null @@ -1,37 +0,0 @@ -/*------------------------------------------------------------------------- - * - * execdefs.h - * - * - * - * Portions Copyright (c) 1996-2002, PostgreSQL Global Development Group - * Portions Copyright (c) 1994, Regents of the University of California - * - * $Id: execdefs.h,v 1.13 2002/06/20 20:29:49 momjian Exp $ - * - *------------------------------------------------------------------------- - */ -#ifndef EXECDEFS_H -#define EXECDEFS_H - -/* ---------------- - * 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_SKIPOUTER_BEGIN 8 -#define EXEC_MJ_SKIPOUTER_TEST 9 -#define EXEC_MJ_SKIPOUTER_ADVANCE 10 -#define EXEC_MJ_SKIPINNER_BEGIN 11 -#define EXEC_MJ_SKIPINNER_TEST 12 -#define EXEC_MJ_SKIPINNER_ADVANCE 13 -#define EXEC_MJ_ENDOUTER 14 -#define EXEC_MJ_ENDINNER 15 - -#endif /* EXECDEFS_H */ diff --git a/src/include/executor/execdesc.h b/src/include/executor/execdesc.h deleted file mode 100644 index 8654746c66e..00000000000 --- a/src/include/executor/execdesc.h +++ /dev/null @@ -1,45 +0,0 @@ -/*------------------------------------------------------------------------- - * - * execdesc.h - * plan and query descriptor accessor macros used by the executor - * and related modules. - * - * - * Portions Copyright (c) 1996-2002, PostgreSQL Global Development Group - * Portions Copyright (c) 1994, Regents of the University of California - * - * $Id: execdesc.h,v 1.19 2002/06/20 20:29:49 momjian 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 */ - const char *portalName; /* name of portal, or NULL */ - - TupleDesc tupDesc; /* set by ExecutorStart */ -} QueryDesc; - -/* in pquery.c */ -extern QueryDesc *CreateQueryDesc(Query *parsetree, Plan *plantree, - CommandDest dest, const char *portalName); - - -#endif /* EXECDESC_H */ diff --git a/src/include/executor/executor.h b/src/include/executor/executor.h deleted file mode 100644 index 70486ab68b1..00000000000 --- a/src/include/executor/executor.h +++ /dev/null @@ -1,182 +0,0 @@ -/*------------------------------------------------------------------------- - * - * executor.h - * support for the POSTGRES executor module - * - * - * Portions Copyright (c) 1996-2002, PostgreSQL Global Development Group - * Portions Copyright (c) 1994, Regents of the University of California - * - * $Id: executor.h,v 1.66 2002/06/20 20:29:49 momjian Exp $ - * - *------------------------------------------------------------------------- - */ -#ifndef EXECUTOR_H -#define EXECUTOR_H - -#include "executor/execdesc.h" - -/* ---------------- - * TupIsNull - * - * This is used mainly to detect when there are no more - * tuples to process. - * ---------------- - */ -/* return: true if tuple in slot is NULL, slot is slot to test */ -#define TupIsNull(slot) \ - ((slot) == NULL || (slot)->val == NULL) - -/* - * prototypes from functions in execAmi.c - */ -extern void ExecReScan(Plan *node, ExprContext *exprCtxt, Plan *parent); -extern void ExecMarkPos(Plan *node); -extern void ExecRestrPos(Plan *node); - -/* - * prototypes from functions in execJunk.c - */ -extern JunkFilter *ExecInitJunkFilter(List *targetList, TupleDesc tupType, - TupleTableSlot *slot); -extern void ExecFreeJunkFilter(JunkFilter *junkfilter); -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, - ScanDirection direction, long count); -extern void ExecutorEnd(QueryDesc *queryDesc, EState *estate); -extern void ExecConstraints(char *caller, ResultRelInfo *resultRelInfo, - TupleTableSlot *slot, EState *estate); -extern TupleTableSlot *EvalPlanQual(EState *estate, Index rti, - ItemPointer tid); - -/* - * 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); -extern TupleDesc ExecGetTupType(Plan *node); - -/* - * prototypes from functions in execQual.c - */ -extern Datum ExecEvalParam(Param *expression, ExprContext *econtext, - bool *isNull); -extern Datum GetAttributeByNum(TupleTableSlot *slot, AttrNumber attrno, - bool *isNull); -extern Datum GetAttributeByName(TupleTableSlot *slot, char *attname, - bool *isNull); -extern Datum ExecMakeFunctionResult(FunctionCachePtr fcache, - List *arguments, - ExprContext *econtext, - bool *isNull, - ExprDoneCond *isDone); -extern Datum ExecEvalExpr(Node *expression, ExprContext *econtext, - bool *isNull, ExprDoneCond *isDone); -extern Datum ExecEvalExprSwitchContext(Node *expression, ExprContext *econtext, - bool *isNull, ExprDoneCond *isDone); -extern bool ExecQual(List *qual, ExprContext *econtext, bool resultForNull); -extern int ExecTargetListLength(List *targetlist); -extern int ExecCleanTargetListLength(List *targetlist); -extern TupleTableSlot *ExecProject(ProjectionInfo *projInfo, - ExprDoneCond *isDone); - -/* - * prototypes from functions in execScan.c - */ -typedef TupleTableSlot *(*ExecScanAccessMtd) (Scan *node); - -extern TupleTableSlot *ExecScan(Scan *node, ExecScanAccessMtd accessMtd); - -/* - * prototypes from functions in execTuples.c - */ -extern TupleTable ExecCreateTupleTable(int initialSize); -extern void ExecDropTupleTable(TupleTable table, bool shouldFree); -extern TupleTableSlot *ExecAllocTableSlot(TupleTable table); -extern TupleTableSlot *MakeTupleTableSlot(void); -extern TupleTableSlot *ExecStoreTuple(HeapTuple tuple, - TupleTableSlot *slot, - Buffer buffer, - bool shouldFree); -extern TupleTableSlot *ExecClearTuple(TupleTableSlot *slot); -extern void ExecSetSlotDescriptor(TupleTableSlot *slot, - TupleDesc tupdesc, bool shouldFree); -extern void ExecSetSlotDescriptorIsNew(TupleTableSlot *slot, bool isNew); -extern void ExecInitResultTupleSlot(EState *estate, CommonState *commonstate); -extern void ExecInitScanTupleSlot(EState *estate, - CommonScanState *commonscanstate); -extern TupleTableSlot *ExecInitExtraTupleSlot(EState *estate); -extern TupleTableSlot *ExecInitNullTupleSlot(EState *estate, - TupleDesc tupType); -extern TupleDesc ExecTypeFromTL(List *targetList); -extern void SetChangedParamList(Plan *node, List *newchg); - -/* - * prototypes from functions in execUtils.c - */ -extern void ResetTupleCount(void); -extern void ExecAssignExprContext(EState *estate, CommonState *commonstate); -extern void ExecAssignResultType(CommonState *commonstate, - TupleDesc tupDesc, bool shouldFree); -extern void ExecAssignResultTypeFromOuterPlan(Plan *node, - CommonState *commonstate); -extern void ExecAssignResultTypeFromTL(Plan *node, CommonState *commonstate); -extern TupleDesc ExecGetResultType(CommonState *commonstate); -extern void ExecAssignProjectionInfo(Plan *node, CommonState *commonstate); -extern void ExecFreeProjectionInfo(CommonState *commonstate); -extern void ExecFreeExprContext(CommonState *commonstate); -extern TupleDesc ExecGetScanType(CommonScanState *csstate); -extern void ExecAssignScanType(CommonScanState *csstate, - TupleDesc tupDesc, bool shouldFree); -extern void ExecAssignScanTypeFromOuterPlan(Plan *node, - CommonScanState *csstate); -extern Form_pg_attribute ExecGetTypeInfo(Relation relDesc); - -extern ExprContext *MakeExprContext(TupleTableSlot *slot, - MemoryContext queryContext); -extern void FreeExprContext(ExprContext *econtext); - -#define ResetExprContext(econtext) \ - MemoryContextReset((econtext)->ecxt_per_tuple_memory) - -extern ExprContext *MakePerTupleExprContext(EState *estate); - -/* Get an EState's per-output-tuple exprcontext, making it if first use */ -#define GetPerTupleExprContext(estate) \ - ((estate)->es_per_tuple_exprcontext ? \ - (estate)->es_per_tuple_exprcontext : \ - MakePerTupleExprContext(estate)) - -#define GetPerTupleMemoryContext(estate) \ - (GetPerTupleExprContext(estate)->ecxt_per_tuple_memory) - -/* Reset an EState's per-output-tuple exprcontext, if one's been created */ -#define ResetPerTupleExprContext(estate) \ - do { \ - if ((estate)->es_per_tuple_exprcontext) \ - ResetExprContext((estate)->es_per_tuple_exprcontext); \ - } while (0) - -extern void ExecOpenIndices(ResultRelInfo *resultRelInfo); -extern void ExecCloseIndices(ResultRelInfo *resultRelInfo); -extern void ExecInsertIndexTuples(TupleTableSlot *slot, ItemPointer tupleid, - EState *estate, bool is_vacuum); - -extern void RegisterExprContextCallback(ExprContext *econtext, - ExprContextCallbackFunction function, - Datum arg); -extern void UnregisterExprContextCallback(ExprContext *econtext, - ExprContextCallbackFunction function, - Datum arg); - -#endif /* EXECUTOR_H */ diff --git a/src/include/executor/functions.h b/src/include/executor/functions.h deleted file mode 100644 index becb78b6426..00000000000 --- a/src/include/executor/functions.h +++ /dev/null @@ -1,21 +0,0 @@ -/*------------------------------------------------------------------------- - * - * functions.h - * Declarations for execution of SQL-language functions. - * - * - * Portions Copyright (c) 1996-2002, PostgreSQL Global Development Group - * Portions Copyright (c) 1994, Regents of the University of California - * - * $Id: functions.h,v 1.19 2002/06/20 20:29:49 momjian Exp $ - * - *------------------------------------------------------------------------- - */ -#ifndef FUNCTIONS_H -#define FUNCTIONS_H - -#include "fmgr.h" - -extern Datum fmgr_sql(PG_FUNCTION_ARGS); - -#endif /* FUNCTIONS_H */ diff --git a/src/include/executor/hashjoin.h b/src/include/executor/hashjoin.h deleted file mode 100644 index 1869feae08b..00000000000 --- a/src/include/executor/hashjoin.h +++ /dev/null @@ -1,96 +0,0 @@ -/*------------------------------------------------------------------------- - * - * hashjoin.h - * internal structures for hash joins - * - * - * Portions Copyright (c) 1996-2002, PostgreSQL Global Development Group - * Portions Copyright (c) 1994, Regents of the University of California - * - * $Id: hashjoin.h,v 1.26 2002/06/20 20:29:49 momjian Exp $ - * - *------------------------------------------------------------------------- - */ -#ifndef HASHJOIN_H -#define HASHJOIN_H - -#include "access/htup.h" -#include "storage/buffile.h" - -/* ---------------------------------------------------------------- - * hash-join hash table structures - * - * Each active hashjoin has a HashJoinTable control block which is - * palloc'd in the executor's per-query context. All other storage needed - * for the hashjoin is kept in private memory contexts, two for each hashjoin. - * This makes it easy and fast to release the storage when we don't need it - * anymore. - * - * The hashtable contexts are made children of the per-query context, ensuring - * that they will be discarded at end of statement even if the join is - * aborted early by an error. (Likewise, any temporary files we make will - * be cleaned up by the virtual file manager in event of an error.) - * - * Storage that should live through the entire join is allocated from the - * "hashCxt", while storage that is only wanted for the current batch is - * allocated in the "batchCxt". By resetting the batchCxt at the end of - * each batch, we free all the per-batch storage reliably and without tedium. - * ---------------------------------------------------------------- - */ - -typedef struct HashJoinTupleData -{ - struct HashJoinTupleData *next; /* link to next tuple in same - * bucket */ - HeapTupleData htup; /* tuple header */ -} HashJoinTupleData; - -typedef HashJoinTupleData *HashJoinTuple; - -typedef struct HashTableData -{ - int nbuckets; /* buckets in use during this batch */ - int totalbuckets; /* total number of (virtual) buckets */ - HashJoinTuple *buckets; /* buckets[i] is head of list of tuples */ - /* buckets array is per-batch storage, as are all the tuples */ - - int nbatch; /* number of batches; 0 means 1-pass join */ - int curbatch; /* current batch #, or 0 during 1st pass */ - - /* - * all these arrays are allocated for the life of the hash join, but - * only if nbatch > 0: - */ - BufFile **innerBatchFile; /* buffered virtual temp file per batch */ - BufFile **outerBatchFile; /* buffered virtual temp file per batch */ - long *outerBatchSize; /* count of tuples in each outer batch - * file */ - long *innerBatchSize; /* count of tuples in each inner batch - * file */ - - /* - * Info about the datatype being hashed. We assume that the inner and - * outer sides of the hash are the same type, or at least - * binary-compatible types. - */ - int16 typLen; - bool typByVal; - - /* - * During 1st scan of inner relation, we get tuples from executor. If - * nbatch > 0 then tuples that don't belong in first nbuckets logical - * buckets get dumped into inner-batch temp files. The same statements - * apply for the 1st scan of the outer relation, except we write - * tuples to outer-batch temp files. If nbatch > 0 then we do the - * following for each batch: 1. Read tuples from inner batch file, - * load into hash buckets. 2. Read tuples from outer batch file, match - * to hash buckets and output. - */ - - MemoryContext hashCxt; /* context for whole-hash-join storage */ - MemoryContext batchCxt; /* context for this-batch-only storage */ -} HashTableData; - -typedef HashTableData *HashJoinTable; - -#endif /* HASHJOIN_H */ diff --git a/src/include/executor/instrument.h b/src/include/executor/instrument.h deleted file mode 100644 index 9079c63ad40..00000000000 --- a/src/include/executor/instrument.h +++ /dev/null @@ -1,39 +0,0 @@ -/*------------------------------------------------------------------------- - * - * instrument.h - * definitions for run-time statistics collection - * - * - * Copyright (c) 2001, PostgreSQL Global Development Group - * - * $Id: instrument.h,v 1.4 2001/11/05 17:46:33 momjian Exp $ - * - *------------------------------------------------------------------------- - */ -#ifndef INSTRUMENT_H -#define INSTRUMENT_H - -#include <sys/time.h> - - -typedef struct Instrumentation -{ - /* Info about current plan cycle: */ - bool running; /* TRUE if we've completed first tuple */ - struct timeval starttime; /* Start time of current iteration of node */ - struct timeval counter; /* Accumulates runtime for this node */ - double firsttuple; /* Time for first tuple of this cycle */ - double tuplecount; /* Tuples so far this cycle */ - /* Accumulated statistics across all completed cycles: */ - double startup; /* Total startup time (in seconds) */ - double total; /* Total total time (in seconds) */ - double ntuples; /* Total tuples produced */ - double nloops; /* # of run cycles for this node */ -} Instrumentation; - -extern Instrumentation *InstrAlloc(void); -extern void InstrStartNode(Instrumentation *instr); -extern void InstrStopNode(Instrumentation *instr, bool returnedTuple); -extern void InstrEndLoop(Instrumentation *instr); - -#endif /* INSTRUMENT_H */ diff --git a/src/include/executor/nodeAgg.h b/src/include/executor/nodeAgg.h deleted file mode 100644 index c912d3c9c09..00000000000 --- a/src/include/executor/nodeAgg.h +++ /dev/null @@ -1,28 +0,0 @@ -/*------------------------------------------------------------------------- - * - * nodeAgg.h - * - * - * - * Portions Copyright (c) 1996-2002, PostgreSQL Global Development Group - * Portions Copyright (c) 1994, Regents of the University of California - * - * $Id: nodeAgg.h,v 1.17 2002/06/20 20:29:49 momjian Exp $ - * - *------------------------------------------------------------------------- - */ -#ifndef NODEAGG_H -#define NODEAGG_H - -#include "fmgr.h" -#include "nodes/plannodes.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); -extern void ExecReScanAgg(Agg *node, ExprContext *exprCtxt, Plan *parent); - -extern Datum aggregate_dummy(PG_FUNCTION_ARGS); - -#endif /* NODEAGG_H */ diff --git a/src/include/executor/nodeAppend.h b/src/include/executor/nodeAppend.h deleted file mode 100644 index 4e9255b795d..00000000000 --- a/src/include/executor/nodeAppend.h +++ /dev/null @@ -1,25 +0,0 @@ -/*------------------------------------------------------------------------- - * - * nodeAppend.h - * - * - * - * Portions Copyright (c) 1996-2002, PostgreSQL Global Development Group - * Portions Copyright (c) 1994, Regents of the University of California - * - * $Id: nodeAppend.h,v 1.17 2002/06/20 20:29:49 momjian Exp $ - * - *------------------------------------------------------------------------- - */ -#ifndef NODEAPPEND_H -#define NODEAPPEND_H - -#include "nodes/plannodes.h" - -extern bool ExecInitAppend(Append *node, EState *estate, Plan *parent); -extern int ExecCountSlotsAppend(Append *node); -extern TupleTableSlot *ExecProcAppend(Append *node); -extern void ExecEndAppend(Append *node); -extern void ExecReScanAppend(Append *node, ExprContext *exprCtxt, Plan *parent); - -#endif /* NODEAPPEND_H */ diff --git a/src/include/executor/nodeFunctionscan.h b/src/include/executor/nodeFunctionscan.h deleted file mode 100644 index 9a59cd217a4..00000000000 --- a/src/include/executor/nodeFunctionscan.h +++ /dev/null @@ -1,27 +0,0 @@ -/*------------------------------------------------------------------------- - * - * nodeFunctionscan.h - * - * - * - * Portions Copyright (c) 1996-2002, PostgreSQL Global Development Group - * Portions Copyright (c) 1994, Regents of the University of California - * - * $Id: nodeFunctionscan.h,v 1.2 2002/06/20 20:29:49 momjian Exp $ - * - *------------------------------------------------------------------------- - */ -#ifndef NODEFUNCTIONSCAN_H -#define NODEFUNCTIONSCAN_H - -#include "nodes/plannodes.h" - -extern TupleTableSlot *ExecFunctionScan(FunctionScan *node); -extern void ExecEndFunctionScan(FunctionScan *node); -extern bool ExecInitFunctionScan(FunctionScan *node, EState *estate, Plan *parent); -extern int ExecCountSlotsFunctionScan(FunctionScan *node); -extern void ExecFunctionMarkPos(FunctionScan *node); -extern void ExecFunctionRestrPos(FunctionScan *node); -extern void ExecFunctionReScan(FunctionScan *node, ExprContext *exprCtxt, Plan *parent); - -#endif /* NODEFUNCTIONSCAN_H */ diff --git a/src/include/executor/nodeGroup.h b/src/include/executor/nodeGroup.h deleted file mode 100644 index b3c4e5bbd05..00000000000 --- a/src/include/executor/nodeGroup.h +++ /dev/null @@ -1,36 +0,0 @@ -/*------------------------------------------------------------------------- - * - * nodeGroup.h - * prototypes for nodeGroup.c - * - * - * Portions Copyright (c) 1996-2002, PostgreSQL Global Development Group - * Portions Copyright (c) 1994, Regents of the University of California - * - * $Id: nodeGroup.h,v 1.22 2002/06/20 20:29:49 momjian Exp $ - * - *------------------------------------------------------------------------- - */ -#ifndef NODEGROUP_H -#define NODEGROUP_H - -#include "nodes/plannodes.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); -extern void ExecReScanGroup(Group *node, ExprContext *exprCtxt, Plan *parent); - -extern bool execTuplesMatch(HeapTuple tuple1, - HeapTuple tuple2, - TupleDesc tupdesc, - int numCols, - AttrNumber *matchColIdx, - FmgrInfo *eqfunctions, - MemoryContext evalContext); -extern FmgrInfo *execTuplesMatchPrepare(TupleDesc tupdesc, - int numCols, - AttrNumber *matchColIdx); - -#endif /* NODEGROUP_H */ diff --git a/src/include/executor/nodeHash.h b/src/include/executor/nodeHash.h deleted file mode 100644 index aed6bb0cf6a..00000000000 --- a/src/include/executor/nodeHash.h +++ /dev/null @@ -1,40 +0,0 @@ -/*------------------------------------------------------------------------- - * - * nodeHash.h - * - * - * - * Portions Copyright (c) 1996-2002, PostgreSQL Global Development Group - * Portions Copyright (c) 1994, Regents of the University of California - * - * $Id: nodeHash.h,v 1.24 2002/06/20 20:29:49 momjian Exp $ - * - *------------------------------------------------------------------------- - */ -#ifndef NODEHASH_H -#define NODEHASH_H - -#include "nodes/plannodes.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 HashJoinTable ExecHashTableCreate(Hash *node); -extern void ExecHashTableDestroy(HashJoinTable hashtable); -extern void ExecHashTableInsert(HashJoinTable hashtable, - ExprContext *econtext, - Node *hashkey); -extern int ExecHashGetBucket(HashJoinTable hashtable, - ExprContext *econtext, - Node *hashkey); -extern HeapTuple ExecScanHashBucket(HashJoinState *hjstate, List *hjclauses, - ExprContext *econtext); -extern void ExecHashTableReset(HashJoinTable hashtable, long ntuples); -extern void ExecReScanHash(Hash *node, ExprContext *exprCtxt, Plan *parent); -extern void ExecChooseHashTableSize(double ntuples, int tupwidth, - int *virtualbuckets, - int *physicalbuckets, - int *numbatches); - -#endif /* NODEHASH_H */ diff --git a/src/include/executor/nodeHashjoin.h b/src/include/executor/nodeHashjoin.h deleted file mode 100644 index d13a8c9b05b..00000000000 --- a/src/include/executor/nodeHashjoin.h +++ /dev/null @@ -1,26 +0,0 @@ -/*------------------------------------------------------------------------- - * - * nodeHashjoin.h - * - * - * - * Portions Copyright (c) 1996-2002, PostgreSQL Global Development Group - * Portions Copyright (c) 1994, Regents of the University of California - * - * $Id: nodeHashjoin.h,v 1.23 2002/06/20 20:29:49 momjian Exp $ - * - *------------------------------------------------------------------------- - */ -#ifndef NODEHASHJOIN_H -#define NODEHASHJOIN_H - -#include "nodes/plannodes.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 void ExecHashJoinSaveTuple(HeapTuple heapTuple, BufFile *file); -extern void ExecReScanHashJoin(HashJoin *node, ExprContext *exprCtxt, Plan *parent); - -#endif /* NODEHASHJOIN_H */ diff --git a/src/include/executor/nodeIndexscan.h b/src/include/executor/nodeIndexscan.h deleted file mode 100644 index 26596e5fdd4..00000000000 --- a/src/include/executor/nodeIndexscan.h +++ /dev/null @@ -1,28 +0,0 @@ -/*------------------------------------------------------------------------- - * - * nodeIndexscan.h - * - * - * - * Portions Copyright (c) 1996-2002, PostgreSQL Global Development Group - * Portions Copyright (c) 1994, Regents of the University of California - * - * $Id: nodeIndexscan.h,v 1.16 2002/06/20 20:29:49 momjian Exp $ - * - *------------------------------------------------------------------------- - */ -#ifndef NODEINDEXSCAN_H -#define NODEINDEXSCAN_H - -#include "nodes/plannodes.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/nodeLimit.h b/src/include/executor/nodeLimit.h deleted file mode 100644 index 16fa6072bee..00000000000 --- a/src/include/executor/nodeLimit.h +++ /dev/null @@ -1,25 +0,0 @@ -/*------------------------------------------------------------------------- - * - * nodeLimit.h - * - * - * - * Portions Copyright (c) 1996-2002, PostgreSQL Global Development Group - * Portions Copyright (c) 1994, Regents of the University of California - * - * $Id: nodeLimit.h,v 1.6 2002/06/20 20:29:49 momjian Exp $ - * - *------------------------------------------------------------------------- - */ -#ifndef NODELIMIT_H -#define NODELIMIT_H - -#include "nodes/plannodes.h" - -extern TupleTableSlot *ExecLimit(Limit *node); -extern bool ExecInitLimit(Limit *node, EState *estate, Plan *parent); -extern int ExecCountSlotsLimit(Limit *node); -extern void ExecEndLimit(Limit *node); -extern void ExecReScanLimit(Limit *node, ExprContext *exprCtxt, Plan *parent); - -#endif /* NODELIMIT_H */ diff --git a/src/include/executor/nodeMaterial.h b/src/include/executor/nodeMaterial.h deleted file mode 100644 index 818fe7590ae..00000000000 --- a/src/include/executor/nodeMaterial.h +++ /dev/null @@ -1,27 +0,0 @@ -/*------------------------------------------------------------------------- - * - * nodeMaterial.h - * - * - * - * Portions Copyright (c) 1996-2002, PostgreSQL Global Development Group - * Portions Copyright (c) 1994, Regents of the University of California - * - * $Id: nodeMaterial.h,v 1.18 2002/06/20 20:29:49 momjian Exp $ - * - *------------------------------------------------------------------------- - */ -#ifndef NODEMATERIAL_H -#define NODEMATERIAL_H - -#include "nodes/plannodes.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 void ExecMaterialMarkPos(Material *node); -extern void ExecMaterialRestrPos(Material *node); -extern void ExecMaterialReScan(Material *node, ExprContext *exprCtxt, Plan *parent); - -#endif /* NODEMATERIAL_H */ diff --git a/src/include/executor/nodeMergejoin.h b/src/include/executor/nodeMergejoin.h deleted file mode 100644 index b7ed7cd75b4..00000000000 --- a/src/include/executor/nodeMergejoin.h +++ /dev/null @@ -1,25 +0,0 @@ -/*------------------------------------------------------------------------- - * - * nodeMergejoin.h - * - * - * - * Portions Copyright (c) 1996-2002, PostgreSQL Global Development Group - * Portions Copyright (c) 1994, Regents of the University of California - * - * $Id: nodeMergejoin.h,v 1.17 2002/06/20 20:29:49 momjian Exp $ - * - *------------------------------------------------------------------------- - */ -#ifndef NODEMERGEJOIN_H -#define NODEMERGEJOIN_H - -#include "nodes/plannodes.h" - -extern TupleTableSlot *ExecMergeJoin(MergeJoin *node); -extern bool ExecInitMergeJoin(MergeJoin *node, EState *estate, Plan *parent); -extern int ExecCountSlotsMergeJoin(MergeJoin *node); -extern void ExecEndMergeJoin(MergeJoin *node); -extern void ExecReScanMergeJoin(MergeJoin *node, ExprContext *exprCtxt, Plan *parent); - -#endif /* NODEMERGEJOIN_H; */ diff --git a/src/include/executor/nodeNestloop.h b/src/include/executor/nodeNestloop.h deleted file mode 100644 index e6224753edc..00000000000 --- a/src/include/executor/nodeNestloop.h +++ /dev/null @@ -1,26 +0,0 @@ -/*------------------------------------------------------------------------- - * - * nodeNestloop.h - * - * - * - * Portions Copyright (c) 1996-2002, PostgreSQL Global Development Group - * Portions Copyright (c) 1994, Regents of the University of California - * - * $Id: nodeNestloop.h,v 1.18 2002/06/20 20:29:49 momjian Exp $ - * - *------------------------------------------------------------------------- - */ -#ifndef NODENESTLOOP_H -#define NODENESTLOOP_H - -#include "nodes/plannodes.h" - -extern TupleTableSlot *ExecNestLoop(NestLoop *node); -extern bool ExecInitNestLoop(NestLoop *node, EState *estate, Plan *parent); -extern int ExecCountSlotsNestLoop(NestLoop *node); -extern void ExecEndNestLoop(NestLoop *node); -extern void ExecReScanNestLoop(NestLoop *node, ExprContext *exprCtxt, - Plan *parent); - -#endif /* NODENESTLOOP_H */ diff --git a/src/include/executor/nodeResult.h b/src/include/executor/nodeResult.h deleted file mode 100644 index 5d90cda001d..00000000000 --- a/src/include/executor/nodeResult.h +++ /dev/null @@ -1,25 +0,0 @@ -/*------------------------------------------------------------------------- - * - * nodeResult.h - * - * - * - * Portions Copyright (c) 1996-2002, PostgreSQL Global Development Group - * Portions Copyright (c) 1994, Regents of the University of California - * - * $Id: nodeResult.h,v 1.15 2002/06/20 20:29:49 momjian Exp $ - * - *------------------------------------------------------------------------- - */ -#ifndef NODERESULT_H -#define NODERESULT_H - -#include "nodes/plannodes.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); -extern void ExecReScanResult(Result *node, ExprContext *exprCtxt, Plan *parent); - -#endif /* NODERESULT_H */ diff --git a/src/include/executor/nodeSeqscan.h b/src/include/executor/nodeSeqscan.h deleted file mode 100644 index 86d591c88c9..00000000000 --- a/src/include/executor/nodeSeqscan.h +++ /dev/null @@ -1,27 +0,0 @@ -/*------------------------------------------------------------------------- - * - * nodeSeqscan.h - * - * - * - * Portions Copyright (c) 1996-2002, PostgreSQL Global Development Group - * Portions Copyright (c) 1994, Regents of the University of California - * - * $Id: nodeSeqscan.h,v 1.15 2002/06/20 20:29:49 momjian Exp $ - * - *------------------------------------------------------------------------- - */ -#ifndef NODESEQSCAN_H -#define NODESEQSCAN_H - -#include "nodes/plannodes.h" - -extern TupleTableSlot *ExecSeqScan(SeqScan *node); -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/nodeSetOp.h b/src/include/executor/nodeSetOp.h deleted file mode 100644 index eb1b8c25189..00000000000 --- a/src/include/executor/nodeSetOp.h +++ /dev/null @@ -1,25 +0,0 @@ -/*------------------------------------------------------------------------- - * - * nodeSetOp.h - * - * - * - * Portions Copyright (c) 1996-2002, PostgreSQL Global Development Group - * Portions Copyright (c) 1994, Regents of the University of California - * - * $Id: nodeSetOp.h,v 1.6 2002/06/20 20:29:49 momjian Exp $ - * - *------------------------------------------------------------------------- - */ -#ifndef NODESETOP_H -#define NODESETOP_H - -#include "nodes/plannodes.h" - -extern TupleTableSlot *ExecSetOp(SetOp *node); -extern bool ExecInitSetOp(SetOp *node, EState *estate, Plan *parent); -extern int ExecCountSlotsSetOp(SetOp *node); -extern void ExecEndSetOp(SetOp *node); -extern void ExecReScanSetOp(SetOp *node, ExprContext *exprCtxt, Plan *parent); - -#endif /* NODESETOP_H */ diff --git a/src/include/executor/nodeSort.h b/src/include/executor/nodeSort.h deleted file mode 100644 index ca2d1d5fb8a..00000000000 --- a/src/include/executor/nodeSort.h +++ /dev/null @@ -1,27 +0,0 @@ -/*------------------------------------------------------------------------- - * - * nodeSort.h - * - * - * - * Portions Copyright (c) 1996-2002, PostgreSQL Global Development Group - * Portions Copyright (c) 1994, Regents of the University of California - * - * $Id: nodeSort.h,v 1.15 2002/06/20 20:29:49 momjian Exp $ - * - *------------------------------------------------------------------------- - */ -#ifndef NODESORT_H -#define NODESORT_H - -#include "nodes/plannodes.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); -extern void ExecReScanSort(Sort *node, ExprContext *exprCtxt, Plan *parent); - -#endif /* NODESORT_H */ diff --git a/src/include/executor/nodeSubplan.h b/src/include/executor/nodeSubplan.h deleted file mode 100644 index a061a420258..00000000000 --- a/src/include/executor/nodeSubplan.h +++ /dev/null @@ -1,19 +0,0 @@ -/*------------------------------------------------------------------------- - * - * nodeSubplan.h - * - *------------------------------------------------------------------------- - */ -#ifndef NODESUBPLAN_H -#define NODESUBPLAN_H - -#include "nodes/plannodes.h" - -extern Datum ExecSubPlan(SubPlan *node, List *pvar, ExprContext *econtext, - bool *isNull); -extern bool ExecInitSubPlan(SubPlan *node, EState *estate, Plan *parent); -extern void ExecReScanSetParamPlan(SubPlan *node, Plan *parent); -extern void ExecSetParamPlan(SubPlan *node, ExprContext *econtext); -extern void ExecEndSubPlan(SubPlan *node); - -#endif /* NODESUBPLAN_H */ diff --git a/src/include/executor/nodeSubqueryscan.h b/src/include/executor/nodeSubqueryscan.h deleted file mode 100644 index e1a5f01aaf2..00000000000 --- a/src/include/executor/nodeSubqueryscan.h +++ /dev/null @@ -1,25 +0,0 @@ -/*------------------------------------------------------------------------- - * - * nodeSubqueryscan.h - * - * - * - * Portions Copyright (c) 1996-2002, PostgreSQL Global Development Group - * Portions Copyright (c) 1994, Regents of the University of California - * - * $Id: nodeSubqueryscan.h,v 1.6 2002/06/20 20:29:49 momjian Exp $ - * - *------------------------------------------------------------------------- - */ -#ifndef NODESUBQUERYSCAN_H -#define NODESUBQUERYSCAN_H - -#include "nodes/plannodes.h" - -extern TupleTableSlot *ExecSubqueryScan(SubqueryScan *node); -extern void ExecEndSubqueryScan(SubqueryScan *node); -extern bool ExecInitSubqueryScan(SubqueryScan *node, EState *estate, Plan *parent); -extern int ExecCountSlotsSubqueryScan(SubqueryScan *node); -extern void ExecSubqueryReScan(SubqueryScan *node, ExprContext *exprCtxt, Plan *parent); - -#endif /* NODESUBQUERYSCAN_H */ diff --git a/src/include/executor/nodeTidscan.h b/src/include/executor/nodeTidscan.h deleted file mode 100644 index b164100690f..00000000000 --- a/src/include/executor/nodeTidscan.h +++ /dev/null @@ -1,27 +0,0 @@ -/*------------------------------------------------------------------------- - * - * nodeTidscan.h - * - * - * - * Portions Copyright (c) 1996-2002, PostgreSQL Global Development Group - * Portions Copyright (c) 1994, Regents of the University of California - * - * $Id: nodeTidscan.h,v 1.9 2002/06/20 20:29:49 momjian Exp $ - * - *------------------------------------------------------------------------- - */ -#ifndef NODETIDSCAN_H -#define NODETIDSCAN_H - -#include "nodes/plannodes.h" - -extern TupleTableSlot *ExecTidScan(TidScan *node); -extern void ExecTidReScan(TidScan *node, ExprContext *exprCtxt, Plan *parent); -extern void ExecEndTidScan(TidScan *node); -extern void ExecTidMarkPos(TidScan *node); -extern bool ExecInitTidScan(TidScan *node, EState *estate, Plan *parent); -extern int ExecCountSlotsTidScan(TidScan *node); -extern void ExecTidReScan(TidScan *node, ExprContext *exprCtxt, Plan *parent); - -#endif /* NODETIDSCAN_H */ diff --git a/src/include/executor/nodeUnique.h b/src/include/executor/nodeUnique.h deleted file mode 100644 index f829b653389..00000000000 --- a/src/include/executor/nodeUnique.h +++ /dev/null @@ -1,25 +0,0 @@ -/*------------------------------------------------------------------------- - * - * nodeUnique.h - * - * - * - * Portions Copyright (c) 1996-2002, PostgreSQL Global Development Group - * Portions Copyright (c) 1994, Regents of the University of California - * - * $Id: nodeUnique.h,v 1.15 2002/06/20 20:29:49 momjian Exp $ - * - *------------------------------------------------------------------------- - */ -#ifndef NODEUNIQUE_H -#define NODEUNIQUE_H - -#include "nodes/plannodes.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); -extern void ExecReScanUnique(Unique *node, ExprContext *exprCtxt, Plan *parent); - -#endif /* NODEUNIQUE_H */ diff --git a/src/include/executor/spi.h b/src/include/executor/spi.h deleted file mode 100644 index 1ff389e8511..00000000000 --- a/src/include/executor/spi.h +++ /dev/null @@ -1,118 +0,0 @@ -/*------------------------------------------------------------------------- - * - * spi.h - * - * $Id: spi.h,v 1.33 2001/11/08 20:37:52 momjian Exp $ - * - *------------------------------------------------------------------------- - */ -#ifndef SPI_H -#define SPI_H - -/* - * This file may be used by client modules that haven't already - * included postgres.h - */ -#include "postgres.h" - -/* - * These are not needed by this file, but used by other programs - * using SPI - */ -#include "nodes/primnodes.h" -#include "nodes/relation.h" -#include "nodes/execnodes.h" -#include "nodes/plannodes.h" -#include "catalog/pg_proc.h" -#include "catalog/pg_type.h" -#include "tcop/pquery.h" -#include "tcop/tcopprot.h" -#include "tcop/utility.h" -#include "tcop/dest.h" -#include "nodes/params.h" -#include "utils/fcache.h" -#include "utils/datum.h" -#include "utils/syscache.h" -#include "utils/builtins.h" -#include "catalog/pg_language.h" -#include "access/heapam.h" -#include "access/xact.h" -#include "executor/executor.h" -#include "executor/execdefs.h" - -typedef struct -{ - MemoryContext tuptabcxt; /* memory context of result table */ - uint32 alloced; /* # of alloced vals */ - uint32 free; /* # of free vals */ - TupleDesc tupdesc; /* tuple descriptor */ - HeapTuple *vals; /* tuples */ -} SPITupleTable; - -#define SPI_ERROR_CONNECT (-1) -#define SPI_ERROR_COPY (-2) -#define SPI_ERROR_OPUNKNOWN (-3) -#define SPI_ERROR_UNCONNECTED (-4) -#define SPI_ERROR_CURSOR (-5) -#define SPI_ERROR_ARGUMENT (-6) -#define SPI_ERROR_PARAM (-7) -#define SPI_ERROR_TRANSACTION (-8) -#define SPI_ERROR_NOATTRIBUTE (-9) -#define SPI_ERROR_NOOUTFUNC (-10) -#define SPI_ERROR_TYPUNKNOWN (-11) - -#define SPI_OK_CONNECT 1 -#define SPI_OK_FINISH 2 -#define SPI_OK_FETCH 3 -#define SPI_OK_UTILITY 4 -#define SPI_OK_SELECT 5 -#define SPI_OK_SELINTO 6 -#define SPI_OK_INSERT 7 -#define SPI_OK_DELETE 8 -#define SPI_OK_UPDATE 9 -#define SPI_OK_CURSOR 10 - -extern DLLIMPORT uint32 SPI_processed; -extern DLLIMPORT Oid SPI_lastoid; -extern DLLIMPORT SPITupleTable *SPI_tuptable; -extern DLLIMPORT int SPI_result; - -extern int SPI_connect(void); -extern int SPI_finish(void); -extern void SPI_push(void); -extern void SPI_pop(void); -extern int SPI_exec(char *src, int tcount); -extern int SPI_execp(void *plan, Datum *values, char *Nulls, int tcount); -extern void *SPI_prepare(char *src, int nargs, Oid *argtypes); -extern void *SPI_saveplan(void *plan); -extern int SPI_freeplan(void *plan); - -extern HeapTuple SPI_copytuple(HeapTuple tuple); -extern TupleDesc SPI_copytupledesc(TupleDesc tupdesc); -extern TupleTableSlot *SPI_copytupleintoslot(HeapTuple tuple, - TupleDesc tupdesc); -extern HeapTuple SPI_modifytuple(Relation rel, HeapTuple tuple, int natts, - int *attnum, Datum *Values, char *Nulls); -extern int SPI_fnumber(TupleDesc tupdesc, char *fname); -extern char *SPI_fname(TupleDesc tupdesc, int fnumber); -extern char *SPI_getvalue(HeapTuple tuple, TupleDesc tupdesc, int fnumber); -extern Datum SPI_getbinval(HeapTuple tuple, TupleDesc tupdesc, int fnumber, bool *isnull); -extern char *SPI_gettype(TupleDesc tupdesc, int fnumber); -extern Oid SPI_gettypeid(TupleDesc tupdesc, int fnumber); -extern char *SPI_getrelname(Relation rel); -extern void *SPI_palloc(Size size); -extern void *SPI_repalloc(void *pointer, Size size); -extern void SPI_pfree(void *pointer); -extern void SPI_freetuple(HeapTuple pointer); -extern void SPI_freetuptable(SPITupleTable *tuptable); - -extern Portal SPI_cursor_open(char *name, void *plan, - Datum *Values, char *Nulls); -extern Portal SPI_cursor_find(char *name); -extern void SPI_cursor_fetch(Portal portal, bool forward, int count); -extern void SPI_cursor_move(Portal portal, bool forward, int count); -extern void SPI_cursor_close(Portal portal); - -extern void AtEOXact_SPI(void); - -#endif /* SPI_H */ diff --git a/src/include/executor/spi_priv.h b/src/include/executor/spi_priv.h deleted file mode 100644 index c780c3656fa..00000000000 --- a/src/include/executor/spi_priv.h +++ /dev/null @@ -1,38 +0,0 @@ -/*------------------------------------------------------------------------- - * - * spi.c - * Server Programming Interface private declarations - * - * $Header: /cvsroot/pgsql/src/include/executor/spi_priv.h,v 1.12 2002/05/21 22:05:55 tgl Exp $ - * - *------------------------------------------------------------------------- - */ -#ifndef SPI_PRIV_H -#define SPI_PRIV_H - -#include "executor/spi.h" - -typedef struct -{ - List *qtlist; - uint32 processed; /* by Executor */ - SPITupleTable *tuptable; - MemoryContext procCxt; /* procedure context */ - MemoryContext execCxt; /* executor context */ - MemoryContext savedcxt; -} _SPI_connection; - -typedef struct -{ - MemoryContext plancxt; - List *qtlist; - List *ptlist; - int nargs; - Oid *argtypes; -} _SPI_plan; - -#define _SPI_CPLAN_CURCXT 0 -#define _SPI_CPLAN_PROCXT 1 -#define _SPI_CPLAN_TOPCXT 2 - -#endif /* SPI_PRIV_H */ diff --git a/src/include/executor/tuptable.h b/src/include/executor/tuptable.h deleted file mode 100644 index 269b81f6632..00000000000 --- a/src/include/executor/tuptable.h +++ /dev/null @@ -1,84 +0,0 @@ -/*------------------------------------------------------------------------- - * - * tuptable.h - * tuple table support stuff - * - * - * Portions Copyright (c) 1996-2002, PostgreSQL Global Development Group - * Portions Copyright (c) 1994, Regents of the University of California - * - * $Id: tuptable.h,v 1.22 2002/06/20 20:29:49 momjian Exp $ - * - * NOTES - * The tuple table interface is getting pretty ugly. - * It should be redesigned soon. - * - *------------------------------------------------------------------------- - */ -#ifndef TUPTABLE_H -#define TUPTABLE_H - -#include "access/htup.h" - -/* ---------------- - * The executor tuple table is managed and manipulated by special - * code in executor/execTuples.c. - * - * TupleTableSlot information - * - * val current tuple, or NULL if no tuple - * shouldFree boolean - should we pfree() tuple - * descIsNew boolean - true when tupleDescriptor changes - * tupleDescriptor type information for the tuple data - * shouldFreeDesc boolean - should we free tupleDescriptor - * buffer the buffer for tuples pointing to disk pages - * - * The executor stores pointers to tuples in a ``tuple table'' - * which is composed of TupleTableSlots. Sometimes the tuples - * are pointers to buffer pages, while others are pointers to - * palloc'ed memory; the shouldFree variable tells us when - * we may call pfree() on a tuple. -cim 9/23/90 - * - * If buffer is not InvalidBuffer, then the slot is holding a pin - * on the indicated buffer page; drop the pin when we release the - * slot's reference to that buffer. - * - * 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 - * - * shouldFreeDesc is similar to shouldFree: if it's true, then the - * tupleDescriptor is "owned" by the TupleTableSlot and should be - * freed when the slot's reference to the descriptor is dropped. - * - * See executor.h for decls of functions defined in execTuples.c - * -jolly - * - * ---------------- - */ -typedef struct TupleTableSlot -{ - NodeTag type; - HeapTuple val; - bool ttc_shouldFree; - bool ttc_descIsNew; - bool ttc_shouldFreeDesc; - TupleDesc ttc_tupleDescriptor; - Buffer ttc_buffer; -} 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; - -#endif /* TUPTABLE_H */ |