Revise hash join code so that we can increase the number of batches
Tom Lane <tgl@sss.pgh.pa.us>
Revise hash join code so that we can increase the number of batches on-the-fly, and thereby avoid blowing out memory when the planner has underestimated the hash table size. Hash join will now obey the work_mem limit with some faithfulness. Per my recent proposal (hash aggregate part isn't done yet though).
Files
| Path | Change | +/− |
|---|---|---|
| src/backend/executor/nodeHash.c | modified | +313 −198 |
| src/backend/executor/nodeHashjoin.c | modified | +228 −165 |
| src/backend/optimizer/path/costsize.c | modified | +10 −8 |
| src/backend/utils/adt/selfuncs.c | modified | +4 −4 |
| src/include/executor/hashjoin.h | modified | +45 −30 |
| src/include/executor/nodeHash.h | modified | +14 −12 |
| src/include/executor/nodeHashjoin.h | modified | +5 −3 |
| src/include/nodes/execnodes.h | modified | +11 −6 |
| src/include/utils/selfuncs.h | modified | +2 −2 |