mirror of https://github.com/citusdata/citus.git
Create CanPushdownSubqery wrapper for better readability (#4108)
parent
73ef40886b
commit
679bf0d2b2
|
@ -1104,7 +1104,7 @@ ErrorHintRequired(const char *errorHint, Query *queryTree)
|
|||
|
||||
|
||||
/*
|
||||
* DeferErrorIfSubqueryNotSupported checks that we can perform distributed planning for
|
||||
* DeferErrorIfUnsupportedSubqueryRepartition checks that we can perform distributed planning for
|
||||
* the given subquery. If not, a deferred error is returned. The function recursively
|
||||
* does this check to all lower levels of the subquery.
|
||||
*/
|
||||
|
|
|
@ -850,6 +850,18 @@ DeferredErrorIfUnsupportedRecurringTuplesJoin(
|
|||
}
|
||||
|
||||
|
||||
/*
|
||||
* CanPushdownSubquery checks if we can push down the given
|
||||
* subquery to worker nodes.
|
||||
*/
|
||||
bool
|
||||
CanPushdownSubquery(Query *subqueryTree, bool outerMostQueryHasLimit)
|
||||
{
|
||||
return DeferErrorIfCannotPushdownSubquery(subqueryTree, outerMostQueryHasLimit) ==
|
||||
NULL;
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* DeferErrorIfCannotPushdownSubquery checks if we can push down the given
|
||||
* subquery to worker nodes. If we cannot push down the subquery, this function
|
||||
|
|
|
@ -889,7 +889,7 @@ ShouldRecursivelyPlanSubquery(Query *subquery, RecursivePlanningContext *context
|
|||
* do not contain any other local tables.
|
||||
*/
|
||||
}
|
||||
else if (DeferErrorIfCannotPushdownSubquery(subquery, false) == NULL)
|
||||
else if (CanPushdownSubquery(subquery, false))
|
||||
{
|
||||
/*
|
||||
* We should do one more check for the distribution key equality.
|
||||
|
|
|
@ -22,7 +22,7 @@
|
|||
/* Config variables managed via guc.c */
|
||||
extern bool SubqueryPushdown;
|
||||
|
||||
|
||||
extern bool CanPushdownSubquery(Query *subqueryTree, bool outerMostQueryHasLimit);
|
||||
extern bool ShouldUseSubqueryPushDown(Query *originalQuery, Query *rewrittenQuery,
|
||||
PlannerRestrictionContext *plannerRestrictionContext);
|
||||
extern bool JoinTreeContainsSubquery(Query *query);
|
||||
|
|
Loading…
Reference in New Issue