3 ms·
> Another problem is fragmentation — because UUIDs are random UUID-4, UUID-3 and UUID-5 are random (3 and 5 are hashes). UUID-1 is time-based with the time le
by masklinn 9y ago
> Another problem is fragmentation — because UUIDs are random
UUID-4, UUID-3 and UUID-5 are random (3 and 5 are hashes).
UUID-1 is time-based with the time leading, and you can often control the sequence (14 bits) and nodeid (48 bits) fields to be used as whatever you want to avoid collisions.
- jonas21 9y agoWith UUIDv1, the low bits of the time come before the high bits, so they still don't sort in time order.
- Someone 9y agoThat depends on how your database sorts UUIDs. SQL server, for example, doesn't sort them in the obvious way (https://blogs.msdn.microsoft.com/sqlprogrammability/2006/11/06/how-are-guids-compared-in-sql-server-2005/ https://blogs.msdn.microsoft.com/sqlprogrammability/2006/11/...) It even is different from how C# orders System.GUID instances. I think that could be something that can be put to good use if there ever is an underhanded C# contest mimicking the underhanded C contest (http://www.underhanded-c.org/ http://www.underhanded-c.org/)