4 ms·
I "independently invented" ULIDs for a past work project. Not a criticism, but something to be aware of, is that SQL Server doesn't sort the uniqueidentifier d
by lazulicurio 6y ago
I "independently invented" ULIDs for a past work project.
Not a criticism, but something to be aware of, is that SQL Server doesn't sort the uniqueidentifier data type as one would expect. Instead of being ordered by bytes 0-1-2-3-4-5-6-7-8-9-10-11-12-13-14-15, uniqueidentifier values are ordered by bytes 10-11-12-13-14-15-8-9-7-6-5-4-3-2-1. So you want the timestamp in the last 48 bits instead of the first 48 bits.
- Vanderson 6y agoWell, this is beyond my ability to grok. Does this apply to ULIDs?
- lazulicurio 6y agoIt will, but looking at the SQL Server implementation[1] it looks like they're already aware of that. [1] https://github.com/rmalayter/ulid-mssql https://github.com/rmalayter/ulid-mssql