You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@shardingsphere.apache.org by Juan Pan <pa...@apache.org> on 2019/11/03 12:52:18 UTC

Re: About key generated by built-in snowflake algorithm(Sharding-JDBC)

Here is the introduction of snowflake[1].


[1] https://shardingsphere.apache.org/document/current/en/features/sharding/other-features/key-generator/


 Juan Pan


panjuan@apache.org
Juan Pan(Trista), Apache ShardingSphere
On 10/31/2019 17:17, 梁维伟 wrote:
Hi.
I found that the result of (the key mod 4) always is 0/1, to me, it is wierd. What I expected is, the result should be 0/1/2/3, and the key should evenly distributed to all the sharded tables. I am new to ShardingSphere and the snowflake algorithm. Hope I can get some help from you.

Thanks.