2
0

nodeHash.h 3.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879
  1. /*-------------------------------------------------------------------------
  2. *
  3. * nodeHash.h
  4. * prototypes for nodeHash.c
  5. *
  6. *
  7. * Portions Copyright (c) 1996-2022, 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. #include "access/parallel.h"
  17. #include "nodes/execnodes.h"
  18. struct SharedHashJoinBatch;
  19. extern HashState *ExecInitHash(Hash *node, EState *estate, int eflags);
  20. extern Node *MultiExecHash(HashState *node);
  21. extern void ExecEndHash(HashState *node);
  22. extern void ExecReScanHash(HashState *node);
  23. extern HashJoinTable ExecHashTableCreate(HashState *state, List *hashOperators, List *hashCollations,
  24. bool keepNulls);
  25. extern void ExecParallelHashTableAlloc(HashJoinTable hashtable,
  26. int batchno);
  27. extern void ExecHashTableDestroy(HashJoinTable hashtable);
  28. extern void ExecHashTableDetach(HashJoinTable hashtable);
  29. extern void ExecHashTableDetachBatch(HashJoinTable hashtable);
  30. extern void ExecParallelHashTableSetCurrentBatch(HashJoinTable hashtable,
  31. int batchno);
  32. extern void ExecHashTableInsert(HashJoinTable hashtable,
  33. TupleTableSlot *slot,
  34. uint32 hashvalue);
  35. extern void ExecParallelHashTableInsert(HashJoinTable hashtable,
  36. TupleTableSlot *slot,
  37. uint32 hashvalue);
  38. extern void ExecParallelHashTableInsertCurrentBatch(HashJoinTable hashtable,
  39. TupleTableSlot *slot,
  40. uint32 hashvalue);
  41. extern bool ExecHashGetHashValue(HashJoinTable hashtable,
  42. ExprContext *econtext,
  43. List *hashkeys,
  44. bool outer_tuple,
  45. bool keep_nulls,
  46. uint32 *hashvalue);
  47. extern void ExecHashGetBucketAndBatch(HashJoinTable hashtable,
  48. uint32 hashvalue,
  49. int *bucketno,
  50. int *batchno);
  51. extern bool ExecScanHashBucket(HashJoinState *hjstate, ExprContext *econtext);
  52. extern bool ExecParallelScanHashBucket(HashJoinState *hjstate, ExprContext *econtext);
  53. extern void ExecPrepHashTableForUnmatched(HashJoinState *hjstate);
  54. extern bool ExecScanHashTableForUnmatched(HashJoinState *hjstate,
  55. ExprContext *econtext);
  56. extern void ExecHashTableReset(HashJoinTable hashtable);
  57. extern void ExecHashTableResetMatchFlags(HashJoinTable hashtable);
  58. extern void ExecChooseHashTableSize(double ntuples, int tupwidth, bool useskew,
  59. bool try_combined_hash_mem,
  60. int parallel_workers,
  61. size_t *space_allowed,
  62. int *numbuckets,
  63. int *numbatches,
  64. int *num_skew_mcvs);
  65. extern int ExecHashGetSkewBucket(HashJoinTable hashtable, uint32 hashvalue);
  66. extern void ExecHashEstimate(HashState *node, ParallelContext *pcxt);
  67. extern void ExecHashInitializeDSM(HashState *node, ParallelContext *pcxt);
  68. extern void ExecHashInitializeWorker(HashState *node, ParallelWorkerContext *pwcxt);
  69. extern void ExecHashRetrieveInstrumentation(HashState *node);
  70. extern void ExecShutdownHash(HashState *node);
  71. extern void ExecHashAccumInstrumentation(HashInstrumentation *instrument,
  72. HashJoinTable hashtable);
  73. #endif /* NODEHASH_H */