codekingpro/portable-devtools
115k
1/*-------------------------------------------------------------------------2 *3 * nodeHash.h4 * prototypes for nodeHash.c5 *6 *7 * Portions Copyright (c) 1996-2023, PostgreSQL Global Development Group8 * Portions Copyright (c) 1994, Regents of the University of California9 *10 * src/include/executor/nodeHash.h11 *12 *-------------------------------------------------------------------------13 */14#ifndef NODEHASH_H15#define NODEHASH_H16 17#include "access/parallel.h"18#include "nodes/execnodes.h"19 20struct SharedHashJoinBatch;21 22extern HashState *ExecInitHash(Hash *node, EState *estate, int eflags);23extern Node *MultiExecHash(HashState *node);24extern void ExecEndHash(HashState *node);25extern void ExecReScanHash(HashState *node);26 27extern HashJoinTable ExecHashTableCreate(HashState *state, List *hashOperators, List *hashCollations,28 bool keepNulls);29extern void ExecParallelHashTableAlloc(HashJoinTable hashtable,30 int batchno);31extern void ExecHashTableDestroy(HashJoinTable hashtable);32extern void ExecHashTableDetach(HashJoinTable hashtable);33extern void ExecHashTableDetachBatch(HashJoinTable hashtable);34extern void ExecParallelHashTableSetCurrentBatch(HashJoinTable hashtable,35 int batchno);36 37extern void ExecHashTableInsert(HashJoinTable hashtable,38 TupleTableSlot *slot,39 uint32 hashvalue);40extern void ExecParallelHashTableInsert(HashJoinTable hashtable,41 TupleTableSlot *slot,42 uint32 hashvalue);43extern void ExecParallelHashTableInsertCurrentBatch(HashJoinTable hashtable,44 TupleTableSlot *slot,45 uint32 hashvalue);46extern bool ExecHashGetHashValue(HashJoinTable hashtable,47 ExprContext *econtext,48 List *hashkeys,49 bool outer_tuple,50 bool keep_nulls,51 uint32 *hashvalue);52extern void ExecHashGetBucketAndBatch(HashJoinTable hashtable,53 uint32 hashvalue,54 int *bucketno,55 int *batchno);56extern bool ExecScanHashBucket(HashJoinState *hjstate, ExprContext *econtext);57extern bool ExecParallelScanHashBucket(HashJoinState *hjstate, ExprContext *econtext);58extern void ExecPrepHashTableForUnmatched(HashJoinState *hjstate);59extern bool ExecParallelPrepHashTableForUnmatched(HashJoinState *hjstate);60extern bool ExecScanHashTableForUnmatched(HashJoinState *hjstate,61 ExprContext *econtext);62extern bool ExecParallelScanHashTableForUnmatched(HashJoinState *hjstate,63 ExprContext *econtext);64extern void ExecHashTableReset(HashJoinTable hashtable);65extern void ExecHashTableResetMatchFlags(HashJoinTable hashtable);66extern 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);73extern int ExecHashGetSkewBucket(HashJoinTable hashtable, uint32 hashvalue);74extern void ExecHashEstimate(HashState *node, ParallelContext *pcxt);75extern void ExecHashInitializeDSM(HashState *node, ParallelContext *pcxt);76extern void ExecHashInitializeWorker(HashState *node, ParallelWorkerContext *pwcxt);77extern void ExecHashRetrieveInstrumentation(HashState *node);78extern void ExecShutdownHash(HashState *node);79extern void ExecHashAccumInstrumentation(HashInstrumentation *instrument,80 HashJoinTable hashtable);81 82#endif /* NODEHASH_H */83 