A fellow tweeter posted the question today on Twitter so I thought I would do a quick blurb about NOLOCK which might help serve as a reference point:
“So how do you convince a team of developers that putting NOLOCK on every single query isn’t a recommended practice?”
He’s probably facing the questions/comments like:
“All NOLOCK does is reads uncommitted rows”
“NOLOCK helps contention on tables that are being updated”
I started “googling” around a bit and found several great articles talking about this subject:
Dave Does Data – NOLOCK Hint and Other Poor Ideas
Dave also links to these articles as well:
SQLCAT – Previously Committed Rows Might Be Missed NOLOCK
Tony Rogerson – Consistency Problem with NOLOCK
Itzik Ben-Gan – Allocation Order Scans with NOLOCK
A great quote I found as well:
“NOLOCK is like a chainsaw, it’s very useful but also dangerous. I don’t think I would put it on any list of standards or best practices if those recommendations would be forced on people who don’t understand what they’re doing.” – Scott
Hopefully these links will give enough information for our DBA friend looking to defend himself vs them nasty developer types
hehehe
A good rule of thumb (that I like to use anyways) for any index hint is:
Only use an index hint when you can PROVE that there is no other way to solve your problem.
Enjoy!!


