• Brandie Tarvin (7/30/2015)


    Why oh why oh why do people insist on using WITH (NOLOCK) instead of doing things like setting transaction isolation levels or fixing indexes to resolve performance issues?

    Work thing. I've been trying to stamp out WITH (NOLOCK) use and now because things "aren't working" one group is trying to throw it back in.

    ARGH!

    Well, this is my battle for the week.

    EDIT: Seriously, can anyone give me a real reason why WITH (NOLOCK) might be functionally necessary for production code?

    It's a combination of gross ignorance and laziness. They don't understand the how and why of locking and blocking. Rather than learn this, and then do the necessary rearchitecting of structure and code, they take the shortcut and use the magic turbo button, NOLOCK.

    The thing about it that really makes me crazy is that if they were at least efficient in their laziness, they'd just change the connection string to READ_UNCOMMITTED. Instead they're doing a ton of extra work in their attempt to be lazy, exposing more ignorance.

    It's a giant pain.

    "The credit belongs to the man who is actually in the arena, whose face is marred by dust and sweat and blood"
    - Theodore Roosevelt

    Author of:
    SQL Server Execution Plans
    SQL Server Query Performance Tuning