-
Notifications
You must be signed in to change notification settings - Fork 916
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
[Feature]: support uuid v7 as a partition key #7682
Comments
UUID version 1, 2, and 6 have timestamps as well, so it is reasonable to support all versions with timestamp as time columns for hypertables. |
Is this something that can be expected to happen quickly? No clue what are the timelines for a typical ask like this with TimescaleDB. |
Older versions of UUID are not suitable as database keys. This is clearly stated in RFC 9562. Only the new version 7 is really popular and worthy of attention and effort. As for version 6, it is a rather crude attempt to fix version 1. I recommend this implementation of version 7: https://git.postgresql.org/gitweb/?p=postgresql.git;a=commitdiff;h=78c5e141e9c13 |
I went with https://github.com/fboulnois/pg_uuidv7 |
It is a temporal solution till PostgreSQL v 18 |
That's fine. It is one of those extensions that are easy to drop when migrating to v18 since there will be direct substitutes. so basically, I am understanding timescale right, there is virtually no downside for me to adopt sharding that's based on a timestamp derived from v7 and storing random value in another column? |
Why not just use the new committed implementation right away?
Note that the timestamp length varies across implementations. The new implementation adds a 12-bit submillisecond segment. But, as far as I understand, for sharding it is enough to take the left part of the timestamp of any length. |
What problem does the new feature solve?
Would like to partition hypertable using uuid v7 / ulid.
What does the feature do?
Allows to use UUID-like time-based value as the primary key of a hypertable.
Implementation challenges
No response
The text was updated successfully, but these errors were encountered: