|
From: Aris S. <ari...@gm...> - 2012-07-04 06:05:14
|
> XC planner is pretty smart, all the clauses are analyzed at the Coordinator level.
If I'm not mistaken, in WITH clause, after a first query run, many sub
of first query will be produced and these sub queries may produce
another queries too (or go to termination condition ). This is a run
time query.
Every sub query produced from another query will be send to
coordinator, to distributed to some of data nodes.
Consider this example from postgres documentation.
WITH RECURSIVE search_graph(id, link, data, depth, path, cycle) AS (
SELECT g.id, g.link, g.data, 1,
ARRAY[ROW(g.f1, g.f2)],
false
FROM graph g
UNION ALL
SELECT g.id, g.link, g.data, sg.depth + 1,
path || ROW(g.f1, g.f2),
ROW(g.f1, g.f2) = ANY(path)
FROM graph g, search_graph sg
WHERE g.id = sg.link AND NOT cycle
)
SELECT * FROM search_graph;
I think many cross node join (intermediated with coordinator) will be happened.
And then WITH clause (in graph search case) will always longer
executed in a cluster than in a single node.
On 7/4/12, Michael Paquier <mic...@gm...> wrote:
> On Wed, Jul 4, 2012 at 2:38 PM, Aris Setyawan <ari...@gm...> wrote:
>
>> Hi All,
>>
>> > Hi Aris,
>> > We found that documents were not updated. WITH clause is supported in
>> XC. Please try
>> > to use it and let us know if it doesn't work for you. Thanks for
>> pointing it out.
>>
>> But how the coordinator will split the WITH clause (recursive) query?
>> If the query wrongly splitted, then many cross datanode join will
>> occurred.
>> This is a well known issue in a graph partitioned database.
>>
> XC planner is pretty smart, all the clauses are analyzed at the Coordinator
> level.
> Then only the necessary clauses and expressions are shipped to the
> necessary remote nodes depending on the table distribution.
> It may be possible that a lot of data is fetched back to Coordinator, but
> this depends on how you defined the table distribution strategy of your
> application.
> --
> Michael Paquier
> http://michael.otacoo.com
>
|