Sample Header Ad - 728x90

Partition by hash on two levels

1 vote
1 answer
210 views
I'm trying to partition a large table by a generated ID(unfortunately it's a mongoDB, so the first few bytes are not evenly distributed) I would like to shard it (using a foreign data wrapper) on this ID. Then within the shard partition again on this ID. How can I set up the hash so that the within the shard so that the data is evenly distributed? If we could use a function like RIGHT, I would shard by the 24th char, then partition by the 23rd. Or if it was a UUID, i'd would do the same but with char1, and char2.
Asked by KevinA (111 rep)
Sep 27, 2021, 04:44 PM
Last activity: Jun 21, 2025, 01:06 PM