-
Notifications
You must be signed in to change notification settings - Fork 11
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support non-numerical key col(s) #8
Comments
@lbradstreet I would like to implement it. Could you give me an insight on how you wanted to implement this? |
Would "non-numerical" include UUIDv4 (random 128bit integers displayed as text), or do those work OK? |
@sventech Now only numerical ids are supported, but this change should add support for UUIDs. |
@mushketyk Actually UUIDv4 is underlyingly numerical (stored as 128 bit integer in PSQL) but I'm not sure if their implementation will treat it as such, or if the column also needs to be monotonically increasing and represented as an |
Sorry, I forgot this is meant to be cross-platform, so PSQL-specific stuff is not relevant. The |
@sventech, yup, we should be able to do something fairly cross-platform by doing the following: If we assume we want n-rows-per-partition, split the uuid key space into n-partitions=(count *)/n-rows-per-partition. Then we select between those ranges, as we currently do with the integer keys. |
Hmm, it looks like for several DB engines, using If the behavior you describe became default, would it break backwards compatibility? Also, it sounds like that would solve the single-column case but perhaps not composite keys (e.g., multiple-columns). But maybe I'm now over my head. :-) |
I think we would have to keep max for integer keyed tables, because the IDs are not uniformly distributed over the key space. With UUIDs we can split up the key space like this because we know that the partitions we generate will contain roughly X rows each.
|
Completed by @mushketyk. Available on Clojars under version |
Would be great if non-numerical key columns were supported.
From @lbradstreet over Gitter:
If it's possible, having a unique identifier specified over multiple columns would be valuable as well.
The text was updated successfully, but these errors were encountered: