From: Michael P. <mic...@gm...> - 2013-02-25 05:33:22
|
On Mon, Feb 25, 2013 at 2:12 PM, kushal <kus...@gm...> wrote: > Is there a way to change the default distribution to distribute by > replication during table generation? > No, there is no such option. You need to specify DISTRIBUTE BY REPLICATION. There were discussions in the XC MLs in the past about adding a GUC that would control default distribution type though. One of the main stopover of this feature is that you need to regenerate the DDL query on Coordinator to take care of cases where nodes have a different default distribution to be sure that things are consistent in the cluster. I hoped that event triggers could implement DDL deparsing in PG core, but it looks that this is not going in for 9.3, and some of the PG committers don't really like of being able to deparse DDL as it would mean that each new DDL command introduced would need to extend also the deparsing, adding unwelcome maintenance. Can I control the number of replicas of any table across datanodes and also > control on what set of datanodes, replica/s can be generated? > Yes. You can control where data of tables is replicated. For example, let's imagine that you have a cluster with Datanodes dn1, dn2, dn3 and dn4, you can create a table in such a way that its data is only replicated on nodes dn2 and dn4 with that: CREATE TABLE aa (a int) DISTRIBUTE BY REPLICATION TO NODE dn2,dn4; You can also specify a group of nodes: CREATE NODE GROUP mygroup WITH (dn2,dn4); CREATE TABLE aa (a int) DISTRIBUTE BY REPLICATION TO GROUP mygroup; -- Michael |