nodeHashjoin.h 1.6 KB
Newer Older
1 2
/*-------------------------------------------------------------------------
 *
3
 * nodeHashjoin.h
4
 *	  prototypes for nodeHashjoin.c
5 6
 *
 *
7
 * Portions Copyright (c) 1996-2008, PostgreSQL Global Development Group
B
Add:  
Bruce Momjian 已提交
8
 * Portions Copyright (c) 1994, Regents of the University of California
9
 *
10
 * $PostgreSQL: pgsql/src/include/executor/nodeHashjoin.h,v 1.34 2007/01/05 22:19:54 momjian Exp $
11 12 13
 *
 *-------------------------------------------------------------------------
 */
14 15
#ifndef NODEHASHJOIN_H
#define NODEHASHJOIN_H
16

17
#include "nodes/execnodes.h"
18
#include "storage/buffile.h"
19

20 21 22
struct HashJoinBatchSide;               /* #include "executor/hashjoin.h" */
struct Instrumentation;                 /* #include "executor/instrument.h" */

23
extern int	ExecCountSlotsHashJoin(HashJoin *node);
24
extern HashJoinState *ExecInitHashJoin(HashJoin *node, EState *estate, int eflags);
25 26 27 28
extern TupleTableSlot *ExecHashJoin(HashJoinState *node);
extern void ExecEndHashJoin(HashJoinState *node);
extern void ExecReScanHashJoin(HashJoinState *node, ExprContext *exprCtxt);

29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47
extern void ExecHashJoinSaveTuple(PlanState *ps, MemTuple tuple, uint32 hashvalue,
								  HashJoinTable hashtable, struct HashJoinBatchSide *batchside,
								  MemoryContext bfCxt);
extern void ExecEagerFreeHashJoin(HashJoinState *node);

extern void ExecHashJoinSaveFirstInnerBatch(HashJoinTable hashtable);

enum 
{
	GPMON_HASHJOIN_SPILLBATCH = GPMON_QEXEC_M_NODE_START,
	GPMON_HASHJOIN_SPILLTUPLE,
	GPMON_HASHJOIN_SPILLBYTE,
	GPMON_HASHJOIN_TOTAL,
};

static inline gpmon_packet_t * GpmonPktFromHashJoinState(HashJoinState *s)
{
	return &s->js.ps.gpmon_pkt;
}
48

49
#endif   /* NODEHASHJOIN_H */