fix style

onur-leftjoin_push-improvements
eaydingol 2025-08-14 15:27:29 +03:00
parent a79b4b31c9
commit c2c6f7b910
2 changed files with 17 additions and 16 deletions

View File

@ -2801,23 +2801,24 @@ JoinTreeContainsLateral(Node *node, List *rtable)
} }
if (IsA(node, RangeTblRef)) if (IsA(node, RangeTblRef))
{ {
RangeTblEntry *rte = rt_fetch(((RangeTblRef *) node)->rtindex, rtable); RangeTblEntry *rte = rt_fetch(((RangeTblRef *) node)->rtindex, rtable);
if (rte == NULL) if (rte == NULL)
{ {
return false; return false;
} }
if (rte->lateral) if (rte->lateral)
{ {
return true; return true;
} }
if(rte->rtekind == RTE_SUBQUERY) if (rte->rtekind == RTE_SUBQUERY)
{ {
if (rte->subquery) if (rte->subquery)
{ {
return JoinTreeContainsLateral((Node *) rte->subquery->jointree, rte->subquery->rtable); return JoinTreeContainsLateral((Node *) rte->subquery->jointree,
rte->subquery->rtable);
} }
} }
return false; return false;
@ -2826,7 +2827,7 @@ JoinTreeContainsLateral(Node *node, List *rtable)
{ {
JoinExpr *join = (JoinExpr *) node; JoinExpr *join = (JoinExpr *) node;
return JoinTreeContainsLateral(join->larg, rtable) || return JoinTreeContainsLateral(join->larg, rtable) ||
JoinTreeContainsLateral(join->rarg, rtable); JoinTreeContainsLateral(join->rarg, rtable);
} }
else if (IsA(node, FromExpr)) else if (IsA(node, FromExpr))
{ {
@ -2844,7 +2845,6 @@ JoinTreeContainsLateral(Node *node, List *rtable)
} }
/* /*
* CheckPushDownFeasibilityAndComputeIndexes checks if the given join expression * CheckPushDownFeasibilityAndComputeIndexes checks if the given join expression
* is a left outer join and if it is feasible to push down the join. If feasible, * is a left outer join and if it is feasible to push down the join. If feasible,
@ -2906,8 +2906,9 @@ CheckPushDownFeasibilityAndComputeIndexes(JoinExpr *joinExpr, Query *query,
/* For now if we see any lateral join in the join tree, we return false. /* For now if we see any lateral join in the join tree, we return false.
* This check can be improved to support the cases where the lateral reference * This check can be improved to support the cases where the lateral reference
* does not cause an error in the final planner checks. * does not cause an error in the final planner checks.
*/ */
if (JoinTreeContainsLateral(joinExpr->rarg, query->rtable) || JoinTreeContainsLateral(joinExpr->larg, query->rtable)) if (JoinTreeContainsLateral(joinExpr->rarg, query->rtable) || JoinTreeContainsLateral(
joinExpr->larg, query->rtable))
{ {
ereport(DEBUG5, (errmsg( ereport(DEBUG5, (errmsg(
"Lateral join is not supported for pushdown in this path."))); "Lateral join is not supported for pushdown in this path.")));