Skip to content
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

test result show not sorted #9

Closed
philiahe opened this issue Jul 11, 2018 · 1 comment
Closed

test result show not sorted #9

philiahe opened this issue Jul 11, 2018 · 1 comment

Comments

@philiahe
Copy link

sort

@richardtallent
Copy link
Owner

Hi,

As mentioned in the documentation, creation of COMBs in very quick succession will result in the same embedded timestamp. COMBs with the same timestamp are sorted essentially randomly, since the sort algorithm of your RDBMS will start sorting on the other (non-timestamp) bits of the GUID.

This is sufficient for most needs, such as determining a primary key for a database table. If you need more of a guarantee that COMBs generated will always sort precisely in insertion order, please use UtcNoRepeatTimestampProvider, ideally with UnixDateTimeStrategy. You can see an example of this in the tests:

https://github.com/richardtallent/RT.Comb/blob/782bdadeaf055d46e580b7572d39649c80b5a45b/test/RT.Comb.Tests/RT.CombTests.cs

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants