3 ms·
No they're entirely separate. The IDs are pure UUIDs with no structure tying them to the desired partition key.
by koolba 8y ago
No they're entirely separate. The IDs are pure UUIDs with no structure tying them to the desired partition key.
- derefr 8y agoCould you switch from UUIDv4s (what I assume you mean by “pure UUIDs”) to UUIDv1s?
- koolba 8y agoNo I've considered that as well as splitting the key to be a composite of the partition key but I'd like an eventual solution for this in the general case where there's no relationship between the partitioning method and the primary key.
- snissn 8y agoAs far as I'm understanding your situtation it seems like you're using range partitioning and then hoping to get benefits of hash partitioning from a range partition. I think you would need to use hash partitions to avoid look ups on every every table. You could do something weird like have each range partition have an exclusion filter and make sure that each of your randomly generated IDs accommodate that exclusion filter, and generate IDs until you find one.. But it sounds like you would benefit from a hash partition here instead of a range one.