↑↓ select↵ open⌫ change scopeOpen full search

PG.CENTER connects PostgreSQL documentation, reference, and ecosystem knowledge. Maintained by Pigsty.

Wiki / Plan Nodes

Hash Join

Probes a hash table built from its inner input while reading its outer input.

Reading PG 18·Select a recorded version

Core node tag
T_HashJoin
Structured EXPLAIN Node Type
Hash Join
Inputs
Outer child and inner Hash plan
Output
Joined tuples according to the selected join type
Executor initializer
ExecInitHashJoin
Memory mechanism
hash-batches
evidence kind
source and documentation
explain names
Hash
explain prefixes
Parallel, Async
node tag
T_HashJoin
parallel callbacks
ExecHashJoinEstimate, ExecHashJoinInitializeDSM, ExecHashJoinInitializeWorker, ExecHashJoinReInitializeDSM
partial modes
Unknown
runtime verified
false
strategies
Unknown

Definition PG 18

Probes a hash table built from its inner input while reading its outer input.

EXPLAIN labels in this source build

Text-format labelStructured node identity
HashHash Join

Compare versions

Complete source facts

memory

{"description":"Hash-join execution can partition work into batches backed by temporary files. This describes hash-join batching, not the spill policy of aggregate or Memoize nodes.","evidence":[{"archive_sha256":"555610c24d53e4316da5b7d3fc25c279d96856d5e0e23ee308c328c5fa881d9f","label":"src/backend/executor/nodeHashjoin.c","path":"src/backend/executor/nodeHashjoin.c","sha256":"4a72b0db253c1905c415462cfe56a2327ac65507c607b6d699d2717fa624ad56","url":"https://ftp.postgresql.org/pub/source/v18.6/postgresql-18.6.tar.bz2"},{"archive_sha256":"555610c24d53e4316da5b7d3fc25c279d96856d5e0e23ee308c328c5fa881d9f","label":"src/backend/executor/nodeHashjoin.c","path":"src/backend/executor/nodeHashjoin.c","sha256":"4a72b0db253c1905c415462cfe56a2327ac65507c607b6d699d2717fa624ad56","url":"https://ftp.postgresql.org/pub/source/v18.6/postgresql-18.6.tar.bz2"}],"mechanism":"hash-batches","source_notes":["If the inner side tuples of a hash join do not fit in memory, the hash join can be executed in multiple batches.","If the statistics on the inner side relation are accurate, planner chooses a multi-batch strategy and estimates the number of batches.","The query executor measures the real size of the hashtable and increases the number of batches if the hashtable grows too large.","The number of batches is always a power of two, so an increase in the number of batches doubles it."]}

source inventory

{"executor":"src/backend/executor/execProcnode.c","explain":"src/backend/commands/explain.c","implementation":"src/backend/executor/nodeHashjoin.c"}

Source references

Full definition and evidence JSON

Definition sources

center · PostgreSQL 18 · 555610c24d53e4316da5b7d3fc25c279d96856d5e0e23ee308c328c5fa881d9f

Text language: en · 555610c24d53e4316da5b7d3fc25c279d96856d5e0e23ee308c328c5fa881d9f