Rotating Header Image

NOLOCK on everything? NOTHANKS!!

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.


Post to Twitter Post to Delicious Post to Digg Post to StumbleUpon

One Comment

  1. The end of the day, I believe things aren’t as rosy for Samsung’s foundry group as the company tried to make it seem by pushing its 14-nanometer technology into production ahead of when TSMC went into production on 16-nanometer FinFET Plus.

Leave a Reply

Twitter links powered by Tweet This v1.6.1, a WordPress plugin for Twitter.