how is a query passed between a coordinator and a datanode - Mailing list pgsql-hackers

From Rui Hai Jiang
Subject how is a query passed between a coordinator and a datanode
Date
Msg-id BAY175-W4237A909E2606638B44F2A0A00@phx.gbl
Whole thread Raw
Responses Re: how is a query passed between a coordinator and a datanode  (Robert Haas <robertmhaas@gmail.com>)
List pgsql-hackers

Hello, 

I'm trying to figure out how a query and its result is passed between a coordinator and a datanode. I know there are
manymessages passed between them to finish a query.
 


I did a test against the coordinator by adding a row to a table and the sql was, insert into hg1(id, name)
values(1,'tom').
 

I found a command 'P' was sent from the coordinator to a datanode and there was a remote statement as following,


stmt_name=p_1_25af_f
query_string=Remote Subplan
plan_string={REMOTESTMT :commandType 3 :hasReturning false ...}


My questions are,1-does the coordinator use the remote statement to tell a datanode what to do? If so, how is the plan
stringcreated by the coordinator and how is the plan_string parsed by the datanode?
 
2-if there are multiple rows in the result of the query, how are the rows of data passed from the datanode to the
coordinator?Does the datanode just send all the rows of data to the coordinator? or the coordinator get each row of
databy sending a query?
 

Thank you very much!
Rui Hai

pgsql-hackers by date:

Previous
From: Kouhei Kaigai
Date:
Subject: Re: upper planner path-ification
Next
From: Sandro Santilli
Date:
Subject: Re: PGXS "check" target forcing an install ?