How to define range for shard.

29 views
Skip to first unread message

chetan....@bizruntime.com

unread,
Mar 17, 2016, 9:22:48 AM3/17/16
to pg_shard users
Hi,

I am using pg_shard. While sharding it takes by default rang for each shard.But i want to define specific rage for every shard while creating like 0-10000, 10000-20000,etc.
Is it possible to create each shard like this.

Plz give me solution with example.



 Thanks & Regards,

Chetan Pachare

Onder Kalaci

unread,
Mar 17, 2016, 10:47:20 AM3/17/16
to pg_shard users
Hi,

pg_shard uses hash partitioning, which means that the rows are distributed with respect to partition column's hash value. For instance, if the partition column value is 1000, its routed to the shard whose range cover hashint4(1000), which is -840720108.  Thus, it is mostly not very convenient to define specific ranges for shards. 

What is the use case you're targeting with defined ranges? 
Reply all
Reply to author
Forward
0 new messages