From 2ea661deece8ca75d93989043d40367d520506f6 Mon Sep 17 00:00:00 2001 From: Tom Lane Date: Tue, 18 May 1999 21:34:29 +0000 Subject: [PATCH] Remove no-longer-used fields in Hash and HashJoin nodes. --- src/backend/nodes/copyfuncs.c | 8 ------ src/backend/nodes/outfuncs.c | 14 ++------- src/backend/nodes/readfuncs.c | 24 ---------------- src/backend/optimizer/plan/createplan.c | 6 ---- src/include/nodes/execnodes.h | 38 ++++++++----------------- src/include/nodes/plannodes.h | 6 ---- 6 files changed, 15 insertions(+), 81 deletions(-) diff --git a/src/backend/nodes/copyfuncs.c b/src/backend/nodes/copyfuncs.c index e4495e81ca..6897f11975 100644 --- a/src/backend/nodes/copyfuncs.c +++ b/src/backend/nodes/copyfuncs.c @@ -357,10 +357,6 @@ _copyHashJoin(HashJoin *from) newnode->hashjoinop = from->hashjoinop; - /* both are unused !.. */ - newnode->hashjointablekey = from->hashjointablekey; - newnode->hashjointablesize = from->hashjointablesize; - return newnode; } @@ -545,10 +541,6 @@ _copyHash(Hash *from) */ Node_Copy(from, newnode, hashkey); - /* both are unused !.. */ - newnode->hashtablekey = from->hashtablekey; - newnode->hashtablesize = from->hashtablesize; - return newnode; } diff --git a/src/backend/nodes/outfuncs.c b/src/backend/nodes/outfuncs.c index 4e94e5d9eb..4de355da13 100644 --- a/src/backend/nodes/outfuncs.c +++ b/src/backend/nodes/outfuncs.c @@ -385,14 +385,11 @@ _outHashJoin(StringInfo str, HashJoin *node) _outNode(str, node->hashclauses); appendStringInfo(str, - " :hashjoinop %u :hashjointable 0x%x :hashjointablekey %d ", - node->hashjoinop, - (int) node->hashjointable, - node->hashjointablekey); + " :hashjoinop %u ", + node->hashjoinop); appendStringInfo(str, - " :hashjointablesize %d :hashdone %d ", - node->hashjointablesize, + " :hashdone %d ", node->hashdone); } @@ -536,11 +533,6 @@ _outHash(StringInfo str, Hash *node) appendStringInfo(str, " :hashkey "); _outNode(str, node->hashkey); - - appendStringInfo(str, " :hashtable 0x%x :hashtablekey %d :hashtablesize %d ", - (int) node->hashtable, - node->hashtablekey, - node->hashtablesize); } /***************************************************************************** diff --git a/src/backend/nodes/readfuncs.c b/src/backend/nodes/readfuncs.c index 0758b6788c..c790c41e8a 100644 --- a/src/backend/nodes/readfuncs.c +++ b/src/backend/nodes/readfuncs.c @@ -454,18 +454,6 @@ _readHashJoin() token = lsptok(NULL, &length); /* get hashjoinop */ local_node->hashjoinop = strtoul(token, NULL, 10); - token = lsptok(NULL, &length); /* eat :hashjointable */ - token = lsptok(NULL, &length); /* eat hashjointable */ - local_node->hashjointable = NULL; - - token = lsptok(NULL, &length); /* eat :hashjointablekey */ - token = lsptok(NULL, &length); /* eat hashjointablekey */ - local_node->hashjointablekey = 0; - - token = lsptok(NULL, &length); /* eat :hashjointablesize */ - token = lsptok(NULL, &length); /* eat hashjointablesize */ - local_node->hashjointablesize = 0; - token = lsptok(NULL, &length); /* eat :hashdone */ token = lsptok(NULL, &length); /* eat hashdone */ local_node->hashdone = false; @@ -680,18 +668,6 @@ _readHash() token = lsptok(NULL, &length); /* eat :hashkey */ local_node->hashkey = (Var *) nodeRead(true); - token = lsptok(NULL, &length); /* eat :hashtable */ - token = lsptok(NULL, &length); /* eat hashtable address */ - local_node->hashtable = NULL; - - token = lsptok(NULL, &length); /* eat :hashtablekey */ - token = lsptok(NULL, &length); /* get hashtablekey */ - local_node->hashtablekey = 0; - - token = lsptok(NULL, &length); /* eat :hashtablesize */ - token = lsptok(NULL, &length); /* get hashtablesize */ - local_node->hashtablesize = 0; - return local_node; } diff --git a/src/backend/optimizer/plan/createplan.c b/src/backend/optimizer/plan/createplan.c index 8d6d5577a1..bfde2d3f46 100644 --- a/src/backend/optimizer/plan/createplan.c +++ b/src/backend/optimizer/plan/createplan.c @@ -1050,9 +1050,6 @@ make_hashjoin(List *tlist, plan->lefttree = lefttree; plan->righttree = righttree; node->hashclauses = hashclauses; - node->hashjointable = NULL; - node->hashjointablekey = 0; - node->hashjointablesize = 0; node->hashdone = false; return node; @@ -1071,9 +1068,6 @@ make_hash(List *tlist, Var *hashkey, Plan *lefttree) plan->lefttree = lefttree; plan->righttree = NULL; node->hashkey = hashkey; - node->hashtable = NULL; - node->hashtablekey = 0; - node->hashtablesize = 0; return node; } diff --git a/src/include/nodes/execnodes.h b/src/include/nodes/execnodes.h index 9caf3b05b0..a1dcd4837f 100644 --- a/src/include/nodes/execnodes.h +++ b/src/include/nodes/execnodes.h @@ -492,24 +492,16 @@ typedef struct MergeJoinState /* ---------------- * HashJoinState information * - * hj_HashTable address of the hash table for the hashjoin - * hj_HashTableShmId shared memory id of hash table - * hj_CurBucket the current hash bucket that we are searching - * for matches of the current outer tuple - * hj_CurTuple the current matching inner tuple in the - * current hash bucket - * hj_CurOTuple the current matching inner tuple in the - * current hash overflow chain + * hj_HashTable hash table for the hashjoin + * hj_CurBucketNo bucket# for current outer tuple + * hj_CurTuple last inner tuple matched to current outer + * tuple, or NULL if starting search + * (CurBucketNo and CurTuple are meaningless + * unless OuterTupleSlot is nonempty!) * hj_InnerHashKey the inner hash key in the hashjoin condition - * hj_OuterBatches file descriptors for outer batches - * hj_InnerBatches file descriptors for inner batches - * hj_OuterReadPos current read position of outer batch - * hj_OuterReadBlk current read block of outer batch * hj_OuterTupleSlot tuple slot for outer tuples * hj_HashTupleSlot tuple slot for hashed tuples * - * - * * JoinState information * * CommonState information @@ -525,16 +517,10 @@ typedef struct MergeJoinState typedef struct HashJoinState { JoinState jstate; /* its first field is NodeTag */ - HashJoinTable hj_HashTable; - IpcMemoryId hj_HashTableShmId; - HashBucket hj_CurBucket; - HeapTuple hj_CurTuple; - OverflowTuple hj_CurOTuple; - Var *hj_InnerHashKey; - File *hj_OuterBatches; - File *hj_InnerBatches; - char *hj_OuterReadPos; - int hj_OuterReadBlk; + HashJoinTable hj_HashTable; + int hj_CurBucketNo; + HashJoinTuple hj_CurTuple; + Var *hj_InnerHashKey; TupleTableSlot *hj_OuterTupleSlot; TupleTableSlot *hj_HashTupleSlot; } HashJoinState; @@ -668,7 +654,7 @@ typedef CommonState UniqueState; /* ---------------- * HashState information * - * hashBatches file descriptors for the batches + * hashtable hash table for the hashjoin * * CommonState information * @@ -683,7 +669,7 @@ typedef CommonState UniqueState; typedef struct HashState { CommonState cstate; /* its first field is NodeTag */ - File *hashBatches; + HashJoinTable hashtable; } HashState; #ifdef NOT_USED diff --git a/src/include/nodes/plannodes.h b/src/include/nodes/plannodes.h index 6259f046fa..d0990d1443 100644 --- a/src/include/nodes/plannodes.h +++ b/src/include/nodes/plannodes.h @@ -221,9 +221,6 @@ typedef struct HashJoin List *hashclauses; Oid hashjoinop; HashJoinState *hashjoinstate; - HashJoinTable hashjointable; - IpcMemoryKey hashjointablekey; - int hashjointablesize; bool hashdone; } HashJoin; @@ -320,9 +317,6 @@ typedef struct Hash Plan plan; Var *hashkey; HashState *hashstate; - HashJoinTable hashtable; - IpcMemoryKey hashtablekey; - int hashtablesize; } Hash; #ifdef NOT_USED -- 2.39.5