From b84cc4b825c5e68836e18f5b1bc094d49c5cb192 Mon Sep 17 00:00:00 2001 From: Onur Tirtir Date: Mon, 18 Aug 2025 10:46:47 +0300 Subject: [PATCH] add a comment --- .../distributed/planner/multi_physical_planner.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/backend/distributed/planner/multi_physical_planner.c b/src/backend/distributed/planner/multi_physical_planner.c index c270ce68f..2c0a17d16 100644 --- a/src/backend/distributed/planner/multi_physical_planner.c +++ b/src/backend/distributed/planner/multi_physical_planner.c @@ -2311,6 +2311,10 @@ QueryPushdownSqlTaskList(Query *query, uint64 jobId, if (!updateQualsForOuterJoin && FindNodeMatchingCheckFunction((Node *) query, IsOuterJoinExpr)) { + /* + * We have an outer join, so assume "might" need to update quals. + * See the usage of this flag in QueryPushdownTaskCreate(). + */ updateQualsForOuterJoin = true; } @@ -2622,6 +2626,14 @@ QueryPushdownTaskCreate(Query *originalQuery, int shardIndex, if (updateQualsForOuterJoin) { + /* + * QueryPushdownSqlTaskList() might set this when it detects an outer join, + * even if the outer join is not surely known to be happening between a + * recurring and a distributed rel. However, it's still safe to call + * UpdateWhereClauseToPushdownRecurringOuterJoinWalker() here as it only + * acts on the where clause if the join is happening between a + * recurring and a distributed rel. + */ UpdateWhereClauseToPushdownRecurringOuterJoinWalker((Node *) taskQuery, relationShardList); }