On Tue, Jan 8, 2013 at 10:18 AM, Adam Estrada <est...@gm...>wrote:
> All,
>
> I see in the documentation that XC does not yet support triggers. If I
> have a table with hundreds of millions of records, I want partition my data
> out in to partition tables to help speed my queries up. The ON INSERT
> trigger decides which function to call (the function has all the partition
> rules in it) which is the postgresql way to do it. How is this handled in
> XC if there is no trigger capability?
>
XC has internal support for Data distribution among nodes using a clause
extension in CREATE TABLE called DISTRIBUTE BY. The distribution can be
defined given a key which needs to be a column of the table:
For example a primary key for hash distribution:
CREATE TABLE aa (a int primary key) DISTRIBUTE BY hash(a);
This is a bit different from the PG partitioning as you do not use in this
case sub-tables with things like CHECK clauses. When distributing a table,
the same table is defined and used among the nodes. Only its tuples are
stored to dedicated nodes automatically.
Please note that similarly you can define replicated tables with DISTRIBUTE
BY REPLICATION.
--
Michael Paquier
http://michael.otacoo.com
|