diff options
author | Tom Lane <tgl@sss.pgh.pa.us> | 2011-06-01 17:01:59 -0400 |
---|---|---|
committer | Tom Lane <tgl@sss.pgh.pa.us> | 2011-06-01 17:01:59 -0400 |
commit | 0c99d41ec887051fb0cc6e35e358ecc936a13584 (patch) | |
tree | 96eddd8f2880c1772595a2b7396488451e635a46 /src/backend/executor/nodeHashjoin.c | |
parent | 596b0c213f2f7ffa72d0d5b68e1da91c366dc72b (diff) | |
download | postgresql-0c99d41ec887051fb0cc6e35e358ecc936a13584.tar.gz postgresql-0c99d41ec887051fb0cc6e35e358ecc936a13584.zip |
Allow hash joins to be interrupted while searching hash table for match.
Per experimentation with a recent example, in which unreasonable amounts
of time could elapse before the backend would respond to a query-cancel.
This might be something to back-patch, but the patch doesn't apply cleanly
because this code was rewritten for 9.1. Given the lack of field
complaints I won't bother for now.
Cédric Villemain
Diffstat (limited to 'src/backend/executor/nodeHashjoin.c')
-rw-r--r-- | src/backend/executor/nodeHashjoin.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/backend/executor/nodeHashjoin.c b/src/backend/executor/nodeHashjoin.c index 26da3b2fdf5..0e7ca625cee 100644 --- a/src/backend/executor/nodeHashjoin.c +++ b/src/backend/executor/nodeHashjoin.c @@ -19,6 +19,7 @@ #include "executor/hashjoin.h" #include "executor/nodeHash.h" #include "executor/nodeHashjoin.h" +#include "miscadmin.h" #include "utils/memutils.h" @@ -263,6 +264,13 @@ ExecHashJoin(HashJoinState *node) case HJ_SCAN_BUCKET: /* + * We check for interrupts here because this corresponds to + * where we'd fetch a row from a child plan node in other + * join types. + */ + CHECK_FOR_INTERRUPTS(); + + /* * Scan the selected hash bucket for matches to current outer */ if (!ExecScanHashBucket(node, econtext)) |