Hello, I found that qual_is_pushdown_safe() has an argument "subquery" that is not used in the function. This argument has not been referred to since the commit 964c0d0f80e485dd3a4073e073ddfd9bfdda90b2.
I think we can remove this if there is no special reason. Regards, Yugo Nagata -- Yugo NAGATA <nag...@sraoss.co.jp>
diff --git a/src/backend/optimizer/path/allpaths.c b/src/backend/optimizer/path/allpaths.c index 4ddaed31a4..5327ea2803 100644 --- a/src/backend/optimizer/path/allpaths.c +++ b/src/backend/optimizer/path/allpaths.c @@ -136,8 +136,7 @@ static void check_output_expressions(Query *subquery, static void compare_tlist_datatypes(List *tlist, List *colTypes, pushdown_safety_info *safetyInfo); static bool targetIsInAllPartitionLists(TargetEntry *tle, Query *query); -static bool qual_is_pushdown_safe(Query *subquery, Index rti, - RestrictInfo *rinfo, +static bool qual_is_pushdown_safe(Index rti, RestrictInfo *rinfo, pushdown_safety_info *safetyInfo); static void subquery_push_qual(Query *subquery, RangeTblEntry *rte, Index rti, Node *qual); @@ -2527,7 +2526,7 @@ set_subquery_pathlist(PlannerInfo *root, RelOptInfo *rel, Node *clause = (Node *) rinfo->clause; if (!rinfo->pseudoconstant && - qual_is_pushdown_safe(subquery, rti, rinfo, &safetyInfo)) + qual_is_pushdown_safe(rti, rinfo, &safetyInfo)) { /* Push it down */ subquery_push_qual(subquery, rte, rti, clause); @@ -3813,7 +3812,7 @@ targetIsInAllPartitionLists(TargetEntry *tle, Query *query) * found to be unsafe to reference by subquery_is_pushdown_safe(). */ static bool -qual_is_pushdown_safe(Query *subquery, Index rti, RestrictInfo *rinfo, +qual_is_pushdown_safe(Index rti, RestrictInfo *rinfo, pushdown_safety_info *safetyInfo) { bool safe = true;