On Tue, Jun 18, 2024 at 8:22 AM Tom Lane <tgl@sss.pgh.pa.us> wrote:
> Probably as a result of switching from custom to generic plan.
> There's not anything exciting about that, but we would like to
> get to the bottom of the DSA allocation failure.
Parallel Hash Right Join is new in 16 (commit 11c2d6fd, whose message
unfortunately focuses on JOIN_FULL but also covered JOIN_RIGHT). I
suspect that the allocation failure might be coming from trying to
allocate a huge array of batches in
ExecParallelHashJoinSetUpBatches(), so large that it exceeds the 1GB
allocation cap. I don't think it's the bucket array, because we avoid
exceeding the cap there. The only other thing it could be is a
massive tuple, which seems unlikely. If that's right, then the
question is: what is it about JOIN_RIGHT that is producing very large
nbatch?
There was a similar report[1] on -hackers. One of the links to
depesz's EXPLAIN viewer shows Parallel Hash Right Join, and the report
includes very high numbers of batches. Hmm.
[1] https://www.postgresql.org/message-id/flat/CAG4TxrizOVnkYx1v1a7rv6G3t4fMoZP6vbZn3yPLgjHrg5ETbw%40mail.gmail.com