Entity Framework separating a clustered index from a primary key

I have a table schema where the primary key is this uniqueidentifierand the clustered index is the type identifier column bigint.

The idea is that the Guid index is likely to be fragmented, and if it is fragmented, I prefer it not to be a clustered index, because then it would really slow down the insertion. Those. I want the row to be inserted sequentially as much as possible.

However, I do NOT want the clustered index to extend to the conceptual layer in EF. A clustered index is simply the physical location of a so-called record, and programmers do not need to know anything about it. As for them, they only deal with Guid PK. So I removed the property from the models.

The compilation of the project complains, however, that the column with the clustered index is not NULL and does not have a default value, any of which is pointless because it is an identifier column and cannot have a default value or be valid.

What can I do to compile the project?

Note. I don't need a discussion about the Guide versus the sequential pointer versus the Int identifier. This system must be able to scale, which means that Guid PK is where I am interested.

+3
source share
1 answer

You must verify that the property value is EntityKeyset to truein EDMX.

+1
source

All Articles