dotnet / dotnet/efcore

SQL Server: string value generator produces a non-sequential Guid

Open
#35,639 2 comments 2 reactions 0 assignees View on GitHub
area-perf area-sqlserver
Dominant language
C#
Stars
14.8k
Forks
3.4k
PR merge metrics
PR metrics pending

Description

On SQL Server, when a Guid property is value-generated, we use the special SequentialGuidValueGenerator; but when a string property is value-generated, we fall back to the core ValueGeneratorSelector, which uses StringValueGenerator, which generates a random Guid and calls ToString() on it. I don't love that we automatically generate Guids for string keys, but since we do, we should generate sequential ones.

Originally raised for PostgreSQL in https://github.com/npgsql/efcore.pg/issues/3460

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.