PostgreSQL Source Code  git master
nodeHash.h
Go to the documentation of this file.
1 /*-------------------------------------------------------------------------
2  *
3  * nodeHash.h
4  * prototypes for nodeHash.c
5  *
6  *
7  * Portions Copyright (c) 1996-2024, PostgreSQL Global Development Group
8  * Portions Copyright (c) 1994, Regents of the University of California
9  *
10  * src/include/executor/nodeHash.h
11  *
12  *-------------------------------------------------------------------------
13  */
14 #ifndef NODEHASH_H
15 #define NODEHASH_H
16 
17 #include "access/parallel.h"
18 #include "nodes/execnodes.h"
19 
20 struct SharedHashJoinBatch;
21 
22 extern HashState *ExecInitHash(Hash *node, EState *estate, int eflags);
23 extern Node *MultiExecHash(HashState *node);
24 extern void ExecEndHash(HashState *node);
25 extern void ExecReScanHash(HashState *node);
26 
27 extern HashJoinTable ExecHashTableCreate(HashState *state, List *hashOperators, List *hashCollations,
28  bool keepNulls);
29 extern void ExecParallelHashTableAlloc(HashJoinTable hashtable,
30  int batchno);
31 extern void ExecHashTableDestroy(HashJoinTable hashtable);
32 extern void ExecHashTableDetach(HashJoinTable hashtable);
33 extern void ExecHashTableDetachBatch(HashJoinTable hashtable);
35  int batchno);
36 
37 extern void ExecHashTableInsert(HashJoinTable hashtable,
38  TupleTableSlot *slot,
39  uint32 hashvalue);
40 extern void ExecParallelHashTableInsert(HashJoinTable hashtable,
41  TupleTableSlot *slot,
42  uint32 hashvalue);
44  TupleTableSlot *slot,
45  uint32 hashvalue);
46 extern bool ExecHashGetHashValue(HashJoinTable hashtable,
47  ExprContext *econtext,
48  List *hashkeys,
49  bool outer_tuple,
50  bool keep_nulls,
51  uint32 *hashvalue);
52 extern void ExecHashGetBucketAndBatch(HashJoinTable hashtable,
53  uint32 hashvalue,
54  int *bucketno,
55  int *batchno);
56 extern bool ExecScanHashBucket(HashJoinState *hjstate, ExprContext *econtext);
57 extern bool ExecParallelScanHashBucket(HashJoinState *hjstate, ExprContext *econtext);
58 extern void ExecPrepHashTableForUnmatched(HashJoinState *hjstate);
60 extern bool ExecScanHashTableForUnmatched(HashJoinState *hjstate,
61  ExprContext *econtext);
63  ExprContext *econtext);
64 extern void ExecHashTableReset(HashJoinTable hashtable);
65 extern void ExecHashTableResetMatchFlags(HashJoinTable hashtable);
66 extern void ExecChooseHashTableSize(double ntuples, int tupwidth, bool useskew,
67  bool try_combined_hash_mem,
68  int parallel_workers,
69  size_t *space_allowed,
70  int *numbuckets,
71  int *numbatches,
72  int *num_skew_mcvs);
73 extern int ExecHashGetSkewBucket(HashJoinTable hashtable, uint32 hashvalue);
74 extern void ExecHashEstimate(HashState *node, ParallelContext *pcxt);
75 extern void ExecHashInitializeDSM(HashState *node, ParallelContext *pcxt);
78 extern void ExecShutdownHash(HashState *node);
80  HashJoinTable hashtable);
81 
82 #endif /* NODEHASH_H */
unsigned int uint32
Definition: c.h:506
void ExecParallelHashTableInsert(HashJoinTable hashtable, TupleTableSlot *slot, uint32 hashvalue)
Definition: nodeHash.c:1714
void ExecParallelHashTableSetCurrentBatch(HashJoinTable hashtable, int batchno)
Definition: nodeHash.c:3472
void ExecHashTableReset(HashJoinTable hashtable)
Definition: nodeHash.c:2299
bool ExecHashGetHashValue(HashJoinTable hashtable, ExprContext *econtext, List *hashkeys, bool outer_tuple, bool keep_nulls, uint32 *hashvalue)
Definition: nodeHash.c:1824
void ExecHashInitializeDSM(HashState *node, ParallelContext *pcxt)
Definition: nodeHash.c:2753
bool ExecParallelScanHashBucket(HashJoinState *hjstate, ExprContext *econtext)
Definition: nodeHash.c:2025
void ExecHashAccumInstrumentation(HashInstrumentation *instrument, HashJoinTable hashtable)
Definition: nodeHash.c:2850
void ExecHashInitializeWorker(HashState *node, ParallelWorkerContext *pwcxt)
Definition: nodeHash.c:2778
void ExecHashTableDetachBatch(HashJoinTable hashtable)
Definition: nodeHash.c:3282
void ExecHashEstimate(HashState *node, ParallelContext *pcxt)
Definition: nodeHash.c:2734
HashState * ExecInitHash(Hash *node, EState *estate, int eflags)
Definition: nodeHash.c:360
void ExecChooseHashTableSize(double ntuples, int tupwidth, bool useskew, bool try_combined_hash_mem, int parallel_workers, size_t *space_allowed, int *numbuckets, int *numbatches, int *num_skew_mcvs)
Definition: nodeHash.c:675
void ExecPrepHashTableForUnmatched(HashJoinState *hjstate)
Definition: nodeHash.c:2076
void ExecHashTableDetach(HashJoinTable hashtable)
Definition: nodeHash.c:3374
bool ExecParallelScanHashTableForUnmatched(HashJoinState *hjstate, ExprContext *econtext)
Definition: nodeHash.c:2236
void ExecHashTableDestroy(HashJoinTable hashtable)
Definition: nodeHash.c:883
int ExecHashGetSkewBucket(HashJoinTable hashtable, uint32 hashvalue)
Definition: nodeHash.c:2528
bool ExecScanHashTableForUnmatched(HashJoinState *hjstate, ExprContext *econtext)
Definition: nodeHash.c:2162
void ExecHashTableResetMatchFlags(HashJoinTable hashtable)
Definition: nodeHash.c:2327
void ExecEndHash(HashState *node)
Definition: nodeHash.c:413
void ExecShutdownHash(HashState *node)
Definition: nodeHash.c:2804
void ExecHashTableInsert(HashJoinTable hashtable, TupleTableSlot *slot, uint32 hashvalue)
Definition: nodeHash.c:1624
void ExecHashGetBucketAndBatch(HashJoinTable hashtable, uint32 hashvalue, int *bucketno, int *batchno)
Definition: nodeHash.c:1932
void ExecParallelHashTableAlloc(HashJoinTable hashtable, int batchno)
Definition: nodeHash.c:3262
HashJoinTable ExecHashTableCreate(HashState *state, List *hashOperators, List *hashCollations, bool keepNulls)
Definition: nodeHash.c:432
bool ExecParallelPrepHashTableForUnmatched(HashJoinState *hjstate)
Definition: nodeHash.c:2097
void ExecParallelHashTableInsertCurrentBatch(HashJoinTable hashtable, TupleTableSlot *slot, uint32 hashvalue)
Definition: nodeHash.c:1780
void ExecReScanHash(HashState *node)
Definition: nodeHash.c:2353
bool ExecScanHashBucket(HashJoinState *hjstate, ExprContext *econtext)
Definition: nodeHash.c:1964
void ExecHashRetrieveInstrumentation(HashState *node)
Definition: nodeHash.c:2819
Node * MultiExecHash(HashState *node)
Definition: nodeHash.c:105
Definition: pg_list.h:54
Definition: nodes.h:129
Definition: regguts.h:323