1
0
mirror of https://github.com/postgres/postgres.git synced 2025-06-29 10:41:53 +03:00

Parallel executor support.

This code provides infrastructure for a parallel leader to start up
parallel workers to execute subtrees of the plan tree being executed
in the master.  User-supplied parameters from ParamListInfo are passed
down, but PARAM_EXEC parameters are not.  Various other constructs,
such as initplans, subplans, and CTEs, are also not currently shared.
Nevertheless, there's enough here to support a basic implementation of
parallel query, and we can lift some of the current restrictions as
needed.

Amit Kapila and Robert Haas
This commit is contained in:
Robert Haas
2015-09-28 21:55:57 -04:00
parent 0557dc276f
commit d1b7c1ffe7
17 changed files with 1007 additions and 2 deletions

View File

@ -174,6 +174,8 @@ static bool extract_query_dependencies_walker(Node *node,
* Currently, relations and user-defined functions are the only types of
* objects that are explicitly tracked this way.
*
* 7. We assign every plan node in the tree a unique ID.
*
* We also perform one final optimization step, which is to delete
* SubqueryScan plan nodes that aren't doing anything useful (ie, have
* no qual and a no-op targetlist). The reason for doing this last is that
@ -436,6 +438,9 @@ set_plan_refs(PlannerInfo *root, Plan *plan, int rtoffset)
if (plan == NULL)
return NULL;
/* Assign this node a unique ID. */
plan->plan_node_id = root->glob->lastPlanNodeId++;
/*
* Plan-type-specific fixes
*/