diff --git a/src/backend/executor/nodeHash.c b/src/backend/executor/nodeHash.c index af5934d2bcfcf804d2840425df927d7946b4760f..e695d8834b550e6408e13fca4a05eea8d48b10a6 100644 --- a/src/backend/executor/nodeHash.c +++ b/src/backend/executor/nodeHash.c @@ -720,6 +720,9 @@ ExecHashIncreaseNumBatches(HashJoinTable hashtable) /* next tuple in this chunk */ idx += MAXALIGN(hashTupleSize); + + /* allow this loop to be cancellable */ + CHECK_FOR_INTERRUPTS(); } /* we're done with this chunk - free it and proceed to the next one */ @@ -1599,6 +1602,9 @@ ExecHashRemoveNextSkewBucket(HashJoinTable hashtable) } hashTuple = nextHashTuple; + + /* allow this loop to be cancellable */ + CHECK_FOR_INTERRUPTS(); } /* diff --git a/src/backend/executor/nodeHashjoin.c b/src/backend/executor/nodeHashjoin.c index 8a04294b40207e4ff2c33ad0499a21bd45994f67..c50d93f43dbe19164e7cae4810bde02e83493d98 100644 --- a/src/backend/executor/nodeHashjoin.c +++ b/src/backend/executor/nodeHashjoin.c @@ -856,6 +856,13 @@ ExecHashJoinGetSavedTuple(HashJoinState *hjstate, size_t nread; MinimalTuple tuple; + /* + * We check for interrupts here because this is typically taken as an + * alternative code path to an ExecProcNode() call, which would include + * such a check. + */ + CHECK_FOR_INTERRUPTS(); + /* * Since both the hash value and the MinimalTuple length word are uint32, * we can read them both in one BufFileRead() call without any type