From: Michael P. <mic...@gm...> - 2010-12-15 06:37:49
|
Please see attached a work-in-progress patch. Avoid to apply it on your code, because it doesn't work yet. I am sending it because I would need some feedback. The patch is decomposed in two parts. First the query is analyzed. In the case of an execute direct being launched on local Coordinator, the query is parsed and analyzed, then it is returned as a normal Query node. As this query is analyzed, it can go through the planner. For an execute direct on a remote node, the query is analyzed to get the command type for pgxc_planner. and the list of nodes is saved in a RemoteQuery node that is returned with Query result using utilityStmt. I tried to change pgxc planner to manage the particular case of EXECUTE DIRECT by keeping in planner the node list set in analyze, but it doesn't seem to be the right way of doing. I am not really an expert of this part of the code, so feedback would be appreciated, particularly on the following points: Is this patch using the correct logic in planner and analyze? Does the query really need to go through the planner? In this case, is setting Query as a CMD_UTILITY with a RemoteQuery node in utilityStmt is enough or not when analyzing? (the patch currently does NOT do it.) Are the Query fields set in analyse correct? Isn't there something missing in the planner that is not set? We rewrite the statement in Query at the end of pg_analyze_rewrite in postgres.c, but it is not the same query for EXECUTE DIRECT? Is this correct to change it directly in XC planner? -- Michael Paquier http://michaelpq.users.sourceforge.net |