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