diff options
author | Tom Lane <tgl@sss.pgh.pa.us> | 2004-09-22 19:13:52 +0000 |
---|---|---|
committer | Tom Lane <tgl@sss.pgh.pa.us> | 2004-09-22 19:13:52 +0000 |
commit | 9fcbe2af11fb966b30117d8ac3c2971d1be14207 (patch) | |
tree | 456b8fcfc82600ec866e153a8f06a0f77a614831 /src/include/executor | |
parent | 5d9f5c20dd29ac9dde19c283a821709839fae102 (diff) |
Arrange for hash join to skip scanning the outer relation if it detects
that the inner one is completely empty. Per recent discussion. Also some
cosmetic cleanups in nearby code.
Diffstat (limited to 'src/include/executor')
-rw-r--r-- | src/include/executor/hashjoin.h | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/src/include/executor/hashjoin.h b/src/include/executor/hashjoin.h index 5dd6c5c8fe2..8a2eba8e0bc 100644 --- a/src/include/executor/hashjoin.h +++ b/src/include/executor/hashjoin.h @@ -7,7 +7,7 @@ * Portions Copyright (c) 1996-2004, PostgreSQL Global Development Group * Portions Copyright (c) 1994, Regents of the University of California * - * $PostgreSQL: pgsql/src/include/executor/hashjoin.h,v 1.32 2004/08/29 04:13:06 momjian Exp $ + * $PostgreSQL: pgsql/src/include/executor/hashjoin.h,v 1.33 2004/09/22 19:13:52 tgl Exp $ * *------------------------------------------------------------------------- */ @@ -47,7 +47,7 @@ typedef struct HashJoinTupleData typedef HashJoinTupleData *HashJoinTuple; -typedef struct HashTableData +typedef struct HashJoinTableData { int nbuckets; /* buckets in use during this batch */ int totalbuckets; /* total number of (virtual) buckets */ @@ -57,6 +57,8 @@ typedef struct HashTableData int nbatch; /* number of batches; 0 means 1-pass join */ int curbatch; /* current batch #, or 0 during 1st pass */ + bool hashNonEmpty; /* did inner plan produce any rows? */ + /* * all these arrays are allocated for the life of the hash join, but * only if nbatch > 0: @@ -90,8 +92,8 @@ typedef struct HashTableData MemoryContext hashCxt; /* context for whole-hash-join storage */ MemoryContext batchCxt; /* context for this-batch-only storage */ -} HashTableData; +} HashJoinTableData; -typedef HashTableData *HashJoinTable; +typedef HashJoinTableData *HashJoinTable; #endif /* HASHJOIN_H */ |