Question

All of my tables have a rowversion column that EF uses for optimistic concurrency checking. Should I create a nonclustered index on this column for faster data retrieval? Each table also has a clustered primary key named Id. Whenever updating data, will EF/SQL try to locate a row based on Id first and then run a rowversion check?

Was it helpful?

Solution

None of your query plans would seek on that column. All writes are performed by filtering on the primary key columns which causes a seek on the index that provides the primary key. The rowversion index never helps.

To answer such questions empirically, compare the execution plans with and without the index in question.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top