|
From: Michael P. <mic...@gm...> - 2013-08-07 06:39:01
|
Your questions are already answered, here are just some additions. On Wed, Aug 7, 2013 at 2:56 PM, amul sul <sul...@ya...> wrote: > 5. Not allowed Modifying distribution columns definition This is true in 1.0, not in 1.1 and above. It is possible to change the distribution type of a table with ALTER TABLE in the upcoming 1.1. Syntax is the same as CREATE TABLE. http://postgres-xc.sourceforge.net/docs/1_1_beta/sql-altertable.html > 5bis. Modifying distribution column values This needs tuple relocation... Don't count on that. > > I am not pretty clear about all those point, so need your help. > My questions are as follow: > > Is distribution on table is possible in following condition ? > 1. relation(table) has Primary key and Foreign key(REFERENCE column) > and both are different? In this case, you can distribute the child table on if column and table have the same data type, and their data is located on the same nodes such as they perfectly map. If this is not the case, you need to replicate the parent table referenced. > 2. If primary key is on ( col1, col2) and Foreign key is only on > (col2) is this O.K, if PRIMARY key is used as distribution column. If parent is distributed with col2, you could be able to enforce the constraint evaluation to Datanodes if child is also distributed with col2, and that the data of parent and child is located on the same datanodes. In other cases, replicate the parent. > 3. If relation has more than one Foreign key (on col1 and col2) As long as the parent is distributed with one column included in the foreign key, it is fine to distribute the child table with the same column. Child and parent would need once again to have their data located on the same nodes. In case 2&3, I am wondering if XC algorithm is smart enough to allow table creation though in those cases... Comments on that? > I think it not possible distribute table in such condition, in this case is > this best way to distributed by ROUND ROBIN or REPLECATE relations? Avoid ROUND ROBIN if you want to have control on the data distributed. -- Michael |