mirror of https://github.com/citusdata/citus.git
Move hasSemiJoin to JoinRestrictionContext (#4256)
parent
3261fc7eef
commit
7cb07c70fa
|
@ -1742,7 +1742,7 @@ multi_join_restriction_hook(PlannerInfo *root,
|
|||
* later safely convert any semi joins in the rewritten query to inner
|
||||
* joins.
|
||||
*/
|
||||
plannerRestrictionContext->hasSemiJoin = plannerRestrictionContext->hasSemiJoin ||
|
||||
joinRestrictionContext->hasSemiJoin = joinRestrictionContext->hasSemiJoin ||
|
||||
extra->sjinfo->jointype == JOIN_SEMI;
|
||||
|
||||
MemoryContextSwitchTo(oldMemoryContext);
|
||||
|
|
|
@ -138,7 +138,9 @@ ShouldUseSubqueryPushDown(Query *originalQuery, Query *rewrittenQuery,
|
|||
* joins of type JOIN_SEMI are sent it is safe to convert all JOIN_SEMI
|
||||
* nodes to JOIN_INNER nodes (which is what is done in MultiNodeTree).
|
||||
*/
|
||||
if (plannerRestrictionContext->hasSemiJoin)
|
||||
JoinRestrictionContext *joinRestrictionContext =
|
||||
plannerRestrictionContext->joinRestrictionContext;
|
||||
if (joinRestrictionContext->hasSemiJoin)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
|
|
@ -1897,6 +1897,9 @@ FilterJoinRestrictionContext(JoinRestrictionContext *joinRestrictionContext, Rel
|
|||
}
|
||||
}
|
||||
|
||||
/* the filtered restriction might not have semiJoin, but it is OK for now */
|
||||
filtererdJoinRestrictionContext->hasSemiJoin = joinRestrictionContext->hasSemiJoin;
|
||||
|
||||
return filtererdJoinRestrictionContext;
|
||||
}
|
||||
|
||||
|
@ -2016,6 +2019,9 @@ RemoveDuplicateJoinRestrictions(JoinRestrictionContext *joinRestrictionContext)
|
|||
lappend(filteredContext->joinRestrictionList, joinRestriction);
|
||||
}
|
||||
|
||||
/* the filtered restriction might not have semiJoin, but it is OK for now */
|
||||
filteredContext->hasSemiJoin = joinRestrictionContext->hasSemiJoin;
|
||||
|
||||
return filteredContext;
|
||||
}
|
||||
|
||||
|
|
|
@ -75,6 +75,7 @@ typedef struct RelationRestriction
|
|||
typedef struct JoinRestrictionContext
|
||||
{
|
||||
List *joinRestrictionList;
|
||||
bool hasSemiJoin;
|
||||
} JoinRestrictionContext;
|
||||
|
||||
typedef struct JoinRestriction
|
||||
|
@ -116,7 +117,6 @@ typedef struct PlannerRestrictionContext
|
|||
* Instead, we keep this struct to pass some extra information.
|
||||
*/
|
||||
FastPathRestrictionContext *fastPathRestrictionContext;
|
||||
bool hasSemiJoin;
|
||||
MemoryContext memoryContext;
|
||||
} PlannerRestrictionContext;
|
||||
|
||||
|
|
Loading…
Reference in New Issue