diff --git a/src/backend/executor/nodeHash.c b/src/backend/executor/nodeHash.c index fbad0f3f13f..a192fa6a8ad 100644 --- a/src/backend/executor/nodeHash.c +++ b/src/backend/executor/nodeHash.c @@ -667,6 +667,9 @@ ExecHashIncreaseNumBatches(HashJoinTable hashtable) } tuple = nexttuple; + + /* allow this loop to be cancellable */ + CHECK_FOR_INTERRUPTS(); } } @@ -1438,6 +1441,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 ff03f169bf6..6c12eb5e428 100644 --- a/src/backend/executor/nodeHashjoin.c +++ b/src/backend/executor/nodeHashjoin.c @@ -911,6 +911,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