Skip to content

Commit

Permalink
Eliminate alien nodes before execution for entry db
Browse files Browse the repository at this point in the history
  • Loading branch information
Sergey Smirnov authored and yjhjstz committed Dec 24, 2024
1 parent e6cd833 commit f9b4e13
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
10 changes: 10 additions & 0 deletions src/backend/cdb/dispatcher/cdbdisp_query.c
Original file line number Diff line number Diff line change
Expand Up @@ -1414,6 +1414,16 @@ formIdleSegmentIdList(void)
}
}

if (cdbs->entry_db_info != NULL)
{
for (i = 0; i < cdbs->total_entry_dbs; i++)
{
CdbComponentDatabaseInfo *cdi = &cdbs->entry_db_info[i];
for (j = 0; j < cdi->numIdleQEs; j++)
segments = lappend_int(segments, cdi->config->segindex);
}
}

return segments;
}

Expand Down
2 changes: 1 addition & 1 deletion src/backend/executor/execMain.c
Original file line number Diff line number Diff line change
Expand Up @@ -551,7 +551,7 @@ standard_ExecutorStart(QueryDesc *queryDesc, int eflags)
*
* TODO: eliminate aliens even on master, if not EXPLAIN ANALYZE
*/
estate->eliminateAliens = execute_pruned_plan && estate->es_sliceTable && estate->es_sliceTable->hasMotions && !IS_QUERY_DISPATCHER();
estate->eliminateAliens = execute_pruned_plan && estate->es_sliceTable && estate->es_sliceTable->hasMotions && (Gp_role == GP_ROLE_EXECUTE);

/*
* Set up an AFTER-trigger statement context, unless told not to, or
Expand Down

0 comments on commit f9b4e13

Please sign in to comment.