forcefully choose recursive plan for inner join btw recurring and nonrecurring parts

pull/6517/head
aykutbozkurt 2022-11-23 15:49:03 +03:00
parent beb63a1f91
commit bb7085bc2f
1 changed files with 15 additions and 11 deletions

View File

@ -664,6 +664,7 @@ RecursivelyPlanRecurringTupleOuterJoins(Node *node, Query *query,
recursivePlanningContext); recursivePlanningContext);
RecursivelyPlanRecurringTupleOuterJoins(joinExpr->rarg, query, RecursivelyPlanRecurringTupleOuterJoins(joinExpr->rarg, query,
recursivePlanningContext); recursivePlanningContext);
switch (joinExpr->jointype) switch (joinExpr->jointype)
{ {
case JOIN_LEFT: case JOIN_LEFT:
@ -846,19 +847,22 @@ RecursivelyPlanDistributedJoinNode(Node *distributedNode, Query *query,
if (IsA(distributedNode, JoinExpr)) if (IsA(distributedNode, JoinExpr))
{ {
/* /*
* XXX: This, for example, means that RecursivelyPlanRecurringTupleOuterJoins * we forcefully choose recursive plan for nonrecurring part of join tree.
* needs to plan inner side, i.e., <distributed> INNER JOIN <distributed>, * We are here only if we cannot push down a join between recurring and non-recurring
* of the following join: * parts with the nonrecurring part consisting of INNER JOIN.
* *
* <recurring> LEFT JOIN (<distributed> INNER JOIN <distributed>) * <ref> left join (<dist> INNER JOIN <dist>)
* * We should recursively plan nonrecurring part i.e. (dist INNER JOIN dist) as a whole.
* However, this would require moving part of the join tree into a
* subquery but this implies that we need to rebuild the rtable and
* re-point all the Vars to the new rtable indexes. We have not
* implemented that yet.
*/ */
ereport(DEBUG4, (errmsg("recursive planner cannot plan distributed sub " JoinExpr *joinExpr = (JoinExpr *) distributedNode;
"join nodes yet"))); Node *leftNode = joinExpr->larg;
Node *rightNode = joinExpr->rarg;
RecursivelyPlanDistributedJoinNode(leftNode, query,
recursivePlanningContext);
RecursivelyPlanDistributedJoinNode(rightNode, query,
recursivePlanningContext);
return; return;
} }