90#define HJTUPLE_OVERHEAD MAXALIGN(sizeof(HashJoinTupleData))
91#define HJTUPLE_MINTUPLE(hjtup) \
92 ((MinimalTuple) ((char *) (hjtup) + HJTUPLE_OVERHEAD))
119#define SKEW_BUCKET_OVERHEAD MAXALIGN(sizeof(HashSkewBucket))
120#define INVALID_SKEW_BUCKET_NO (-1)
121#define SKEW_HASH_MEM_PERCENT 2
122#define SKEW_MIN_OUTER_FRACTION 0.01
150#define HASH_CHUNK_SIZE (32 * 1024L)
151#define HASH_CHUNK_HEADER_SIZE MAXALIGN(sizeof(HashMemoryChunkData))
152#define HASH_CHUNK_DATA(hc) (((char *) (hc)) + HASH_CHUNK_HEADER_SIZE)
154#define HASH_CHUNK_THRESHOLD (HASH_CHUNK_SIZE / 4)
182#define ParallelHashJoinBatchInner(batch) \
183 ((SharedTuplestore *) \
184 ((char *) (batch) + MAXALIGN(sizeof(ParallelHashJoinBatch))))
187#define ParallelHashJoinBatchOuter(batch, nparticipants) \
188 ((SharedTuplestore *) \
189 ((char *) ParallelHashJoinBatchInner(batch) + \
190 MAXALIGN(sts_estimate(nparticipants))))
193#define EstimateParallelHashJoinBatch(hashtable) \
194 (MAXALIGN(sizeof(ParallelHashJoinBatch)) + \
195 MAXALIGN(sts_estimate((hashtable)->parallel_state->nparticipants)) * 2)
198#define NthParallelHashJoinBatch(base, n) \
199 ((ParallelHashJoinBatch *) \
201 EstimateParallelHashJoinBatch(hashtable) * (n)))
269#define PHJ_BUILD_ELECT 0
270#define PHJ_BUILD_ALLOCATE 1
271#define PHJ_BUILD_HASH_INNER 2
272#define PHJ_BUILD_HASH_OUTER 3
273#define PHJ_BUILD_RUN 4
274#define PHJ_BUILD_FREE 5
277#define PHJ_BATCH_ELECT 0
278#define PHJ_BATCH_ALLOCATE 1
279#define PHJ_BATCH_LOAD 2
280#define PHJ_BATCH_PROBE 3
281#define PHJ_BATCH_SCAN 4
282#define PHJ_BATCH_FREE 5
285#define PHJ_GROW_BATCHES_ELECT 0
286#define PHJ_GROW_BATCHES_REALLOCATE 1
287#define PHJ_GROW_BATCHES_REPARTITION 2
288#define PHJ_GROW_BATCHES_DECIDE 3
289#define PHJ_GROW_BATCHES_FINISH 4
290#define PHJ_GROW_BATCHES_PHASE(n) ((n) % 5)
293#define PHJ_GROW_BUCKETS_ELECT 0
294#define PHJ_GROW_BUCKETS_REALLOCATE 1
295#define PHJ_GROW_BUCKETS_REINSERT 2
296#define PHJ_GROW_BUCKETS_PHASE(n) ((n) % 3)
struct HashMemoryChunkData * HashMemoryChunk
struct HashJoinTupleData HashJoinTupleData
struct ParallelHashJoinBatch ParallelHashJoinBatch
struct HashSkewBucket HashSkewBucket
struct ParallelHashJoinBatchAccessor ParallelHashJoinBatchAccessor
struct HashJoinTableData HashJoinTableData
struct ParallelHashJoinState ParallelHashJoinState
@ PHJ_GROWTH_NEED_MORE_BUCKETS
@ PHJ_GROWTH_NEED_MORE_BATCHES
struct HashMemoryChunkData HashMemoryChunkData
struct HashJoinTupleData ** unshared
ParallelHashJoinBatchAccessor * batches
union HashJoinTableData::@107 buckets
ParallelHashJoinState * parallel_state
HashMemoryChunk current_chunk
BufFile ** innerBatchFile
int log2_nbuckets_optimal
dsa_pointer_atomic * shared
BufFile ** outerBatchFile
dsa_pointer current_chunk_shared
HashSkewBucket ** skewBucket
union HashJoinTupleData::@105 next
struct HashJoinTupleData * unshared
union HashMemoryChunkData::@106 next
struct HashMemoryChunkData * unshared
SharedTuplestoreAccessor * outer_tuples
ParallelHashJoinBatch * shared
SharedTuplestoreAccessor * inner_tuples
Barrier grow_batches_barrier
dsa_pointer chunk_work_queue
Barrier grow_buckets_barrier
ParallelHashGrowth growth
pg_atomic_uint32 distributor