When I generate several Guids, with SequentialAsString type, in a 'for' loop
for (int i = 0; i < 20; i++)
System.Console.WriteLine(SeqGuid.NewGuid(SequentialGuidType.SequentialAsString));
it gives the following guids:
39c27317-3f03-3ed1-2a27-d0e4b21bc541
39c27317-3f04-c80a-a605-59a55e951bfa
39c27317-3f04-b3dd-8464-7d229af028bc
39c27317-3f04-8fe5-fe83-dbcfe4067dc1
39c27317-3f04-6f10-84dd-75d5d0e89aa7
As you can see third and fourth Guid does not look sequential ?
I am using this for PostgreSql.
Now from what I understand first 2 block shold be sequential but here they are the same.
Obviously generator is using some time value and this is created in milliseconds that it gives the same result.
So is this a valid SeqGuid, if not can it be fixed ?
One way I could fix it is using some sleep method in loop, what do you think?
When I generate several Guids, with SequentialAsString type, in a 'for' loop
it gives the following guids:
39c27317-3f03-3ed1-2a27-d0e4b21bc541
39c27317-3f04-c80a-a605-59a55e951bfa
39c27317-3f04-b3dd-8464-7d229af028bc
39c27317-3f04-8fe5-fe83-dbcfe4067dc1
39c27317-3f04-6f10-84dd-75d5d0e89aa7
As you can see third and fourth Guid does not look sequential ?
I am using this for PostgreSql.
Now from what I understand first 2 block shold be sequential but here they are the same.
Obviously generator is using some time value and this is created in milliseconds that it gives the same result.
So is this a valid SeqGuid, if not can it be fixed ?
One way I could fix it is using some sleep method in loop, what do you think?