Menu

#66 The Result plan is put inside a remotesubplan for the insert query.

9.2rc
open
nobody
None
None
None
nobody
2015-09-17
2015-09-17
No

Configuration:

1 GTM, 1 Coordinator, 2 Datanodes(datanode1, datanode2)

Query:
insert into contact (id, name, phone) values (1,'tom','12345678');

Problem:
Coordinator composes a Remote Plan which includes the ModifyTable plan. The ModifyTable plan includes another Remote Plan which includes the Result plan. Coordinator sends the whole Remote plan to both datanode1[backend process 1] and datanode2[backend process 2].
When datanode1[backend process 1] recieves the plan, it runs the plan and sends the Result plan to datanode1[backend process 3] and get the row from datanode1[backend process 3]. Similarly ,when datanode2[backend process 2] recieves the plan, it sends the Result plan to datanode1[backend process 4] and get the row from datanode1[backend process 4].

I checked the code and found the Result plan is put into the Remote plan in the following code.
Is it possible to optimize the code to remove the Remote plan?

static Plan
grouping_planner(PlannerInfo
root, double tuple_fraction)
{
.....
else
result_plan = (Plan *) make_remotesubplan(root,
result_plan,
root->distribution,
distribution,
NULL);
.....
return result_plan;
}

Discussion


Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.