문제

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?

도움이 되었습니까?

해결책

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.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top