Debian Codegraph @

src/include/executor/nodeHash.h

raw
1 /*-------------------------------------------------------------------------
2 *
3 * nodeHash.h
4 * prototypes for nodeHash.c
5 *
6 *
7 * Portions Copyright (c) 1996-2025, 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);
28 extern void ExecParallelHashTableAlloc(HashJoinTable hashtable,
29 int batchno);
30 extern void ExecHashTableDestroy(HashJoinTable hashtable);
31 extern void ExecHashTableDetach(HashJoinTable hashtable);
32 extern void ExecHashTableDetachBatch(HashJoinTable hashtable);
33 extern void ExecParallelHashTableSetCurrentBatch(HashJoinTable hashtable,
34 int batchno);
35
36 extern void ExecHashTableInsert(HashJoinTable hashtable,
37 TupleTableSlot *slot,
38 uint32 hashvalue);
39 extern void ExecParallelHashTableInsert(HashJoinTable hashtable,
40 TupleTableSlot *slot,
41 uint32 hashvalue);
42 extern void ExecParallelHashTableInsertCurrentBatch(HashJoinTable hashtable,
43 TupleTableSlot *slot,
44 uint32 hashvalue);
45 extern void ExecHashGetBucketAndBatch(HashJoinTable hashtable,
46 uint32 hashvalue,
47 int *bucketno,
48 int *batchno);
49 extern bool ExecScanHashBucket(HashJoinState *hjstate, ExprContext *econtext);
50 extern bool ExecParallelScanHashBucket(HashJoinState *hjstate, ExprContext *econtext);
51 extern void ExecPrepHashTableForUnmatched(HashJoinState *hjstate);
52 extern bool ExecParallelPrepHashTableForUnmatched(HashJoinState *hjstate);
53 extern bool ExecScanHashTableForUnmatched(HashJoinState *hjstate,
54 ExprContext *econtext);
55 extern bool ExecParallelScanHashTableForUnmatched(HashJoinState *hjstate,
56 ExprContext *econtext);
57 extern void ExecHashTableReset(HashJoinTable hashtable);
58 extern void ExecHashTableResetMatchFlags(HashJoinTable hashtable);
59 extern void ExecChooseHashTableSize(double ntuples, int tupwidth, bool useskew,
60 bool try_combined_hash_mem,
61 int parallel_workers,
62 size_t *space_allowed,
63 int *numbuckets,
64 int *numbatches,
65 int *num_skew_mcvs);
66 extern int ExecHashGetSkewBucket(HashJoinTable hashtable, uint32 hashvalue);
67 extern void ExecHashEstimate(HashState *node, ParallelContext *pcxt);
68 extern void ExecHashInitializeDSM(HashState *node, ParallelContext *pcxt);
69 extern void ExecHashInitializeWorker(HashState *node, ParallelWorkerContext *pwcxt);
70 extern void ExecHashRetrieveInstrumentation(HashState *node);
71 extern void ExecShutdownHash(HashState *node);
72 extern void ExecHashAccumInstrumentation(HashInstrumentation *instrument,
73 HashJoinTable hashtable);
74
75 #endif /* NODEHASH_H */