Re:How many ways are there to sort GUIDs?
by Tornhoof on Tuesday April 30, 2019 @02:22AM
(#19785574)
Here is a more recent post with benchmarks of different GUID algorithms in SQL Server, the author has a different outcome.
In his benchmarks about index fragmentation, COMBGuid is not really much better than normal GUIDs.
http://microsoftprogrammers.jebarson.com/benchmarking-index-...
Re:How many ways are there to sort GUIDs?
by tracker1 on Tuesday April 30, 2019 @12:41PM
(#19789516)
It does look like the sequencial ids (not the combs) does about 50% better overall, and the comb from nhibernate does about 10% better than just random uuids .. this is in terms of paging and indexes.. total time to run the test isn't bad, but that's just the insert time. If you're generating from your application layer and storing in SQL Server, looks like the best option is UuidCreateSequential.
SQL is optimized for the portion that is timestamp based when using v1 algorithms, because it results in better indexing performance. It's also why there's a sequencial id option with SQL server.
Other systems/databases will sort the raw bytes differently, other languages/platforms will use different arrangements. IIRC MongoDB's JS API actually has like 3-4 different serialization options because of these inconsistencies between languages/platforms.
Edit:
https://codingsight.com/combguid-generation-of-sql-server-fr...
NOTE: sequencial id's are not quite the same, they're part of the auto insert so that they are ensured sequencial... this is the best indexing option for SQL Server, though a COMB is probably easiest for applications. Other dbms will structure them differently, so best do figure out your serialization strategy based on your db.