From 1aa86f6b1c765dd50da5be0cb50f7d86b66bc444 Mon Sep 17 00:00:00 2001 From: Nils Dijk Date: Thu, 21 Jan 2021 13:59:47 +0100 Subject: [PATCH] more simplification and removal of unused code --- .../distributed/planner/path_based_planner.c | 20 +-------------- .../distributed/planner/pattern_match.h | 25 ++++++------------- 2 files changed, 9 insertions(+), 36 deletions(-) diff --git a/src/backend/distributed/planner/path_based_planner.c b/src/backend/distributed/planner/path_based_planner.c index 53fd581b2..349a67576 100644 --- a/src/backend/distributed/planner/path_based_planner.c +++ b/src/backend/distributed/planner/path_based_planner.c @@ -749,24 +749,6 @@ typedef struct GeoJoinPathMatch } GeoJoinPathMatch; -static Path * -SkipTransparentPaths(Path *path) -{ - switch (path->type) - { - case T_MaterialPath: - { - return SkipTransparentPaths(castNode(MaterialPath, path)->subpath); - } - - default: - { - return path; - } - } -} - - #include "distributed/planner/pattern_match.h" static List * GeoOverlapJoin(PlannerInfo *root, Path *originalPath) @@ -791,7 +773,7 @@ GeoOverlapJoin(PlannerInfo *root, Path *originalPath) MatchVar(NoCapture), MatchConst( &match.stdwithinDistanceConst, - MatchConstFields(consttype == FLOAT8OID))))), + MatchFields(consttype == FLOAT8OID))))), /* match inner path in join */ SkipReadThrough( NoCapture, diff --git a/src/include/distributed/planner/pattern_match.h b/src/include/distributed/planner/pattern_match.h index d5e5439a8..ba07a7f8f 100644 --- a/src/include/distributed/planner/pattern_match.h +++ b/src/include/distributed/planner/pattern_match.h @@ -301,17 +301,17 @@ if (matched) } -#define MatchVarValuesInternal(index, check) \ +#define MatchFieldsInternal(index, check) \ { \ - if (!(castNode(Var, clause)->check)) \ + if (!(typedClause->check)) \ { \ MatchFailed; \ } \ } -#define MatchVarFields(...) \ - FOR_EACH(MatchVarValuesInternal, __VA_ARGS__); +#define MatchFields(...) \ + FOR_EACH(MatchFieldsInternal, __VA_ARGS__); #define MatchVar(capture, ...) \ @@ -320,30 +320,21 @@ if (matched) { \ MatchFailed; \ } \ + Var *typedClause = castNode(Var, clause); \ + (void) typedClause; \ __VA_ARGS__; \ DoCapture(capture, Var *, clause); \ } -#define MatchConstValuesInternal(index, check) \ -{ \ - if (!(castNode(Const, clause)->check)) \ - { \ - MatchFailed; \ - } \ -} - - -#define MatchConstFields(...) \ - FOR_EACH(MatchConstValuesInternal, __VA_ARGS__); - - #define MatchConst(capture, ...) \ { \ if (!IsA(clause, Const)) \ { \ MatchFailed; \ } \ + Const *typedClause = castNode(Const, clause); \ + (void) typedClause; \ __VA_ARGS__; \ DoCapture(capture, Const *, clause); \ }