|
From: Fabiola R. <fab...@gm...> - 2014-07-11 21:28:49
|
Queries with multiple Joins are giving me trouble. My postgres-xc configuration is as follows: 2 datanodes, 1 coordinator, 1 gtm Each on a different server. I have 5 tables loaded equally on both nodes: 1 replicated and 4 distributed by hash on the correspondent Join attributes. When I run the query on a simple PostgreSQL server, it takes about 20 seconds to finish the execution, but it seems like it will never come to an end whenever I run the query on my postgres-xc server; I have waited over three hours waiting for it to end. Nevertheless, if I do "EXECUTE DIRECT ON node# 'query'", it takes up to 5 seconds tops on both nodes. Suppose my tables are... tableR --- Replicated table table1 --- distributed by hash on (id) table2, table3 & table4 --- distributed by hash on (t1id) ... And: table1 has 2200000 records table2 has 2160000 records table3 has 2190000 records table4 has 6596 records tableR has 223 records The query is basically something like this: SELECT COUNT(*) FROM table1 JOIN table2 ON table2.t1id = table1.id LEFT OUTER JOIN table3 ON table3.t1id = table1.id LEFT OUTER JOIN table4 ON table4.t1id = table1.id LEFT OUTER JOIN tableR ON tableR.id = table4.tRid; Thank you very much, Fabiola Rosato. |