Sample Header Ad - 728x90

How does creating an index help with NOLOCK problems?

-1 votes
1 answer
934 views
Link: https://www.brentozar.com/archive/2018/10/using-nolock-heres-how-youll-get-the-wrong-query-results/ The article mentions some problems with using NOLOCK: - You can see rows twice - You can skip rows altogether - You can see data that was never committed - Your query can outright fail with an error, “could not continue scan with nolock due to data movement” Then a fix is mentioned as: > Create an index on the table (any single-field index would have worked > fine in this particular example, giving SQL Server a narrower copy of > the table to scan) How does creating an index help with NOLOCK problems?
Asked by variable (3590 rep)
Mar 1, 2022, 05:34 AM
Last activity: Mar 1, 2022, 04:37 PM