Merge pull request #1981 from citusdata/faster_execute_subplans

Skip call to ActiveReadableNodeList when there are no subplans
pull/1969/head
Marco Slot 2018-01-29 17:20:44 +01:00 committed by GitHub
commit 0303dfc463
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 9 additions and 1 deletions

View File

@ -34,9 +34,17 @@ ExecuteSubPlans(DistributedPlan *distributedPlan)
uint64 planId = distributedPlan->planId;
List *subPlanList = distributedPlan->subPlanList;
ListCell *subPlanCell = NULL;
List *nodeList = ActiveReadableNodeList();
List *nodeList = NIL;
bool writeLocalFile = false;
if (subPlanList == NIL)
{
/* no subplans to execute */
return;
}
nodeList = ActiveReadableNodeList();
foreach(subPlanCell, subPlanList)
{
DistributedSubPlan *subPlan = (DistributedSubPlan *) lfirst(subPlanCell);