[Postgres-xl-general] How to shard data between data nodes

Фадеев Виталий Львович fvl at mail.ru
Wed Feb 10 02:48:13 PST 2016


 I already tried this.
All my inserts goes to datanode2.


>Вторник,  9 февраля 2016, 11:38 -05:00 от Mason Sharp <mason.sharp at gmail.com>:
>
>
>
>On Tue, Feb 9, 2016 at 6:33 AM, Фадеев Виталий Львович  < fvl at mail.ru > wrote:
>>Hello!
>>
>>We have two nodes. Configuration is:
>> node_name | node_type | node_port |   node_host   | nodeis_primary | nodeis_preferred |   node_id   
>>-----------+-----------+-----------+---------------+----------------+------------------+-------------
>> coord1    | C         |      5432 | 172.16.100.11 | f              | f                |  1885696643
>> datanode1 | D         |     15432 | 172.16.100.11 | f              | f                |   888802358
>> coord2    | C         |      5432 | 172.16.100.12 | f              | f                | -1197102633
>> datanode2 | D         |     15432 | 172.16.100.12 | f              | f                |  -905831925
>>(4 rows)
>>
>>And we have this table for example:
>>
>>CREATE TABLE code_test_table2
>>(
>>id bigserial NOT NULL,
>>client_info text NOT NULL DEFAULT '',
>>client_name text NOT NULL DEFAULT '' )
>>
>
>
> 
>>How we can shard rows based on client_name? 
>>For example: client_name=test to store only on datanode1 and client_name=etc on datanode2 only?
>>
>
>There currently is no range, value, nor custom distributions..yet.
>
>For now though you could distribute by a hash of the client_name, like
>
>CREATE TABLE code_test_table2
>(
>id bigserial NOT NULL,
>client_info text NOT NULL DEFAULT '',
>client_name text NOT NULL DEFAULT '' ) 
>DISTRIBUTE BY HASH(client_name);
>
>Regards,
>
>Mason
>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.postgres-xl.org/pipermail/postgres-xl-general-postgres-xl.org/attachments/20160210/421efcc6/attachment.htm>


More information about the postgres-xl-general mailing list