From f6747434873693e001737ca06c30dcbcc2320b20 Mon Sep 17 00:00:00 2001 From: Tom Lane Date: Sun, 14 May 2017 11:07:40 -0400 Subject: [PATCH] Remove no-longer-needed fields of Hash plan nodes. skewColType/skewColTypmod are no longer used in the wake of commit 9aab83fc5, and seem unlikely to be wanted in future, so let's drop 'em. Discussion: https://postgr.es/m/16364.1494520862@sss.pgh.pa.us --- src/backend/nodes/copyfuncs.c | 2 -- src/backend/nodes/outfuncs.c | 2 -- src/backend/nodes/readfuncs.c | 2 -- src/backend/optimizer/plan/createplan.c | 18 +++--------------- src/include/nodes/plannodes.h | 5 +---- 5 files changed, 4 insertions(+), 25 deletions(-) diff --git a/src/backend/nodes/copyfuncs.c b/src/backend/nodes/copyfuncs.c index d13a6fc03f..6ad38443a0 100644 --- a/src/backend/nodes/copyfuncs.c +++ b/src/backend/nodes/copyfuncs.c @@ -1052,8 +1052,6 @@ _copyHash(const Hash *from) COPY_SCALAR_FIELD(skewTable); COPY_SCALAR_FIELD(skewColumn); COPY_SCALAR_FIELD(skewInherit); - COPY_SCALAR_FIELD(skewColType); - COPY_SCALAR_FIELD(skewColTypmod); return newnode; } diff --git a/src/backend/nodes/outfuncs.c b/src/backend/nodes/outfuncs.c index 3d5b09aeee..8d9ff63931 100644 --- a/src/backend/nodes/outfuncs.c +++ b/src/backend/nodes/outfuncs.c @@ -898,8 +898,6 @@ _outHash(StringInfo str, const Hash *node) WRITE_OID_FIELD(skewTable); WRITE_INT_FIELD(skewColumn); WRITE_BOOL_FIELD(skewInherit); - WRITE_OID_FIELD(skewColType); - WRITE_INT_FIELD(skewColTypmod); } static void diff --git a/src/backend/nodes/readfuncs.c b/src/backend/nodes/readfuncs.c index f9a227e237..e24f5d6726 100644 --- a/src/backend/nodes/readfuncs.c +++ b/src/backend/nodes/readfuncs.c @@ -2187,8 +2187,6 @@ _readHash(void) READ_OID_FIELD(skewTable); READ_INT_FIELD(skewColumn); READ_BOOL_FIELD(skewInherit); - READ_OID_FIELD(skewColType); - READ_INT_FIELD(skewColTypmod); READ_DONE(); } diff --git a/src/backend/optimizer/plan/createplan.c b/src/backend/optimizer/plan/createplan.c index 52daf43c81..1c252c0ef5 100644 --- a/src/backend/optimizer/plan/createplan.c +++ b/src/backend/optimizer/plan/createplan.c @@ -224,9 +224,7 @@ static HashJoin *make_hashjoin(List *tlist, static Hash *make_hash(Plan *lefttree, Oid skewTable, AttrNumber skewColumn, - bool skewInherit, - Oid skewColType, - int32 skewColTypmod); + bool skewInherit); static MergeJoin *make_mergejoin(List *tlist, List *joinclauses, List *otherclauses, List *mergeclauses, @@ -4065,8 +4063,6 @@ create_hashjoin_plan(PlannerInfo *root, Oid skewTable = InvalidOid; AttrNumber skewColumn = InvalidAttrNumber; bool skewInherit = false; - Oid skewColType = InvalidOid; - int32 skewColTypmod = -1; /* * HashJoin can project, so we don't have to demand exact tlists from the @@ -4153,8 +4149,6 @@ create_hashjoin_plan(PlannerInfo *root, skewTable = rte->relid; skewColumn = var->varattno; skewInherit = rte->inh; - skewColType = var->vartype; - skewColTypmod = var->vartypmod; } } } @@ -4165,9 +4159,7 @@ create_hashjoin_plan(PlannerInfo *root, hash_plan = make_hash(inner_plan, skewTable, skewColumn, - skewInherit, - skewColType, - skewColTypmod); + skewInherit); /* * Set Hash node's startup & total costs equal to total cost of input @@ -5427,9 +5419,7 @@ static Hash * make_hash(Plan *lefttree, Oid skewTable, AttrNumber skewColumn, - bool skewInherit, - Oid skewColType, - int32 skewColTypmod) + bool skewInherit) { Hash *node = makeNode(Hash); Plan *plan = &node->plan; @@ -5442,8 +5432,6 @@ make_hash(Plan *lefttree, node->skewTable = skewTable; node->skewColumn = skewColumn; node->skewInherit = skewInherit; - node->skewColType = skewColType; - node->skewColTypmod = skewColTypmod; return node; } diff --git a/src/include/nodes/plannodes.h b/src/include/nodes/plannodes.h index 164105a3a9..0b08e49dd4 100644 --- a/src/include/nodes/plannodes.h +++ b/src/include/nodes/plannodes.h @@ -858,8 +858,7 @@ typedef struct GatherMerge * * If the executor is supposed to try to apply skew join optimization, then * skewTable/skewColumn/skewInherit identify the outer relation's join key - * column, from which the relevant MCV statistics can be fetched. Also, its - * type information is provided to save a lookup. + * column, from which the relevant MCV statistics can be fetched. * ---------------- */ typedef struct Hash @@ -868,8 +867,6 @@ typedef struct Hash Oid skewTable; /* outer join key's table OID, or InvalidOid */ AttrNumber skewColumn; /* outer join key's column #, or zero */ bool skewInherit; /* is outer join rel an inheritance tree? */ - Oid skewColType; /* datatype of the outer key column */ - int32 skewColTypmod; /* typmod of the outer key column */ /* all other info is in the parent HashJoin node */ } Hash; -- 2.40.0