From 177c56d608d834ee1b0869e4e6a5b73de4227ea4 Mon Sep 17 00:00:00 2001 From: Robert Haas Date: Fri, 17 Jun 2016 13:01:14 -0400 Subject: [PATCH] postgres_fdw: Rephrase comment. Per gripe from Thomas Munro, who only complained about a more localized problem, but I couldn't resist a bit more wordsmithing. --- contrib/postgres_fdw/postgres_fdw.c | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/contrib/postgres_fdw/postgres_fdw.c b/contrib/postgres_fdw/postgres_fdw.c index 4b6ec14c65..ccfad1b82a 100644 --- a/contrib/postgres_fdw/postgres_fdw.c +++ b/contrib/postgres_fdw/postgres_fdw.c @@ -4264,16 +4264,15 @@ postgresGetForeignJoinPaths(PlannerInfo *root, fpinfo->attrs_used = NULL; /* - * In case there is a possibility that EvalPlanQual will be executed, we - * should be able to reconstruct the row, from base relations applying all - * the conditions. We create a local plan from a suitable local path - * available in the path list. In case such a path doesn't exist, we can - * not push the join to the foreign server since we won't be able to + * If there is a possibility that EvalPlanQual will be executed, we need + * to be able to reconstruct the row using scans of the base relations. + * GetExistingLocalJoinPath will find a suitable path for this purpose in + * the path list of the joinrel, if one exists. We must be careful to + * call it before adding any ForeignPath, since the ForeignPath might + * dominate the only suitable local path available. We also do it before * reconstruct the row for EvalPlanQual(). Find an alternative local path - * before we add ForeignPath, lest the new path would kick possibly the - * only local path. Do this before calling foreign_join_ok(), since that - * function updates fpinfo and marks it as pushable if the join is found - * to be pushable. + * calling foreign_join_ok(), since that function updates fpinfo and marks + * it as pushable if the join is found to be pushable. */ if (root->parse->commandType == CMD_DELETE || root->parse->commandType == CMD_UPDATE || -- 2.40.0