-
Notifications
You must be signed in to change notification settings - Fork 0
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
A more complex structure of generated version 7 UUIDs is needed #1
Comments
Hi! Well, pull requests are welcome :) |
Andrey, your implementation is too simplified and therefore is not reliable enough. It needs to be advanced for database applications. It does not take into account many concerns that are described in the standard draft and were discussed in detail during its development:
I strongly advise you to read the sections: |
Actually the code is taken from standard draft :) |
Luckily this code was thrown out from the new version of standard draft: https://datatracker.ietf.org/doc/draft-ietf-uuidrev-rfc4122bis/02/ I am not a programmer. Actualy I am a system analist and I use SQL, not C language. So I cannot write a pull request for you. It would be a pity if a wonderful updated standard got a poor implementation in a hurry. It's well known that every complex problem has a simple solution that doesn't work. |
OK, I can help with C part. Can you plz sort needed improvements by some priority and help me develop incremental changed towards "real" UUIDv7 and UUIDv8? |
I'll try to do it this week |
Required UUIDv7 generator features for PostgreSQL
|
Is it all applied to v7 only? We are not looking at v8 right now, are we? I think in v7 we already have property (1). So maybe let's start with (11) "Reseeded CSPRNG". How often should we reseed PRGN? I think it is already reseeded on fork()s. |
It is correct. UUIDv8 is not intended for mass market
I don't understand C language well, so I didn't see this property in your program
It is up to you
Maybe. It's better to check |
Andrey, pgsql-hackers: https://www.postgresql.org/message-id/PH0PR11MB5029DF5E0A0EAF8E3CC2C652BBA29@PH0PR11MB5029.namprd11.prod.outlook.com |
Are you aware that you are posting a link to my thread in pgsql-hackers? |
Yes, I am |
Sure, I'll chat with Ivan next monday on pgconf.ru . So, let's work on this implementation. Where do we start to do it better? |
I know about the conference: https://pgconf.ru/2023/345765 |
I talked to Ivan Panchenko about ULIDs with counters 4 years ego. But it was too early Oleg Bartunov was aware of this discussion |
I added the 17th feature into the table |
Andrey, did you manage to discuss the joint development of the UUIDv7 generator with Ivan Frolkov? |
Not yet, the conference start on April 2nd (I was wrong about next Monday, sorry) |
Interesting, thanks.My implementation lacks that counter bits and metadata. Counter is easy to implement, but does is have to be little endian, big endian or, perhaps, can be in native format?It’s straightforward to add this counter to GitHub implementation, however I’d suppose to do development in pgsql-hackers.Do you have a telegram, btw?--Отправлено из мобильной Яндекс Почты29.07.2023, 01:53, "Sergey Prokhorenko" ***@***.***>:
My drawing of the proposed UUIDv7 structure:
—Reply to this email directly, view it on GitHub, or unsubscribe.You are receiving this because you commented.Message ID: ***@***.***>
|
BTW this 15 bits counter and 65 bits of entropy (compared to 16 bits counter and 64 bits of entropy) is going to be significant performance drainer. We do not generate entropy bit by bit. We are going to generate 5 unaligned bytes and overwrite 7 bits by counter. |
OK, I've read the standard. This particular version https://datatracker.ietf.org/doc/html/draft-ietf-uuidrev-rfc4122bis-08#name-uuid-version-7
|
Andrey, My Telegram account is https://t.me/SergeyProkhorenko ( The rate of UUIDv7 generation by modern computers usually does not allow filling the counter completely longer than 15 bits. But I don't mind a little increase in the length of the counter. The counter must be big-endian, as is the timestamp. The counter has the following benefits:
The initialization every millisecond and increment of the 15-bit counter are independent of the generation of the 59-bit UUIDv7's pseudo-random segment. |
Hi Andrew,
Could you please describe in the README page the structure of your generated version 7 UUIDs, something like https://habr.com/ru/post/658855/comments/#comment_24491432
The text was updated successfully, but these errors were encountered: