Create CanPushdownSubqery wrapper for better readability (#4108)

pull/4110/head
SaitTalhaNisanci 2020-08-12 17:28:20 +03:00 committed by GitHub
parent 73ef40886b
commit 679bf0d2b2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 15 additions and 3 deletions

View File

@ -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.
*/

View File

@ -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

View File

@ -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.

View File

@ -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);