Merge pull request #2396 from citusdata/insert_select_parameters

Do not allow unresolved parameters in INSERT...SELECT
pull/2404/head
Marco Slot 2018-09-24 15:05:55 +02:00 committed by GitHub
commit b2c3fd891b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 10 additions and 0 deletions

View File

@ -595,6 +595,16 @@ CreateDistributedPlan(uint64 planId, Query *originalQuery, Query *query, ParamLi
if (InsertSelectIntoDistributedTable(originalQuery))
{
if (hasUnresolvedParams)
{
/*
* Unresolved parameters can cause performance regressions in
* INSERT...SELECT when the partition column is a parameter
* because we don't perform any additional pruning in the executor.
*/
return NULL;
}
distributedPlan =
CreateInsertSelectPlan(originalQuery, plannerRestrictionContext);
}