4 ms·
Isn’t that exactly what the NEWSEQUENTIALID function was created for? https://docs.microsoft.com/en-us/sql/t-sql/functions/newsequentialid-transact-sql https:/
by jeremy_wiebe 9y ago
Isn’t that exactly what the NEWSEQUENTIALID function was created for?
https://docs.microsoft.com/en-us/sql/t-sql/functions/newsequentialid-transact-sql https://docs.microsoft.com/en-us/sql/t-sql/functions/newsequ...
- slg 9y agoIn theory yes, it solves some of the problems and introduces others. It isn't usable everywhere NEWID is usable, so if you assign UUIDS as part of a query you are out of luck. It also assumes you are generating all your UUIDs on the same machine without restarting which once again negates some of the benefits of UUIDs.
- tatersolid 9y agoULIDs solve these issues. Basically 48 bits of millisecond timestamp then 80 bits of randomness. The technique has been used in MSSQL apps since about 2003 (although people called them COMBs instead of ULIDs back then) https://github.com/oklog/ulid https://github.com/oklog/ulid
- slg 9y agoNice, I hadn't seen that before. It looks pretty good on first glance.