I seem to have gotten quite a few questions about this lately, so I’m going to write down some thoughts here.
Read the post: In SQL Server, Isolation Levels Don’t Control Locking
AI Training for Database Teams and SQL Server Performance Tuning
I seem to have gotten quite a few questions about this lately, so I’m going to write down some thoughts here.
Read the post: In SQL Server, Isolation Levels Don’t Control Locking
Indexes that are written to but rarely read make lock escalation arrive sooner, because every index that contains the updated column adds locks.
You may occasionally see in your favorite monitoring tool, or Most Fantastic And Glorious Script For Determining Whom Activity Belongs To™ that a read…
Read the post: When Read Queries Block Write Queries In SQL Server
Indexes remind me of salt. And no, not because they’re fun to put on slugs.
Let’s say we have a super important query. It’s not really important.
Read the post: SQL Server Index Key Column Order And Locking
Alright, I’ve lied to you already. There are way more than two words involved, here.
Read the post: Should An Optimistic Isolation Level Be The New Default For SQL Server Databases?
While a lot of people speak highly of optimistic locking because it cuts down on blocking issues, I think it’s of equal or higher value that dirty reads…
Read the post: The Real Value Of Optimistic Isolation Levels In SQL Server
I know you don’t have bad queries. You’re smart people. But some people do!
I recently came across a bad locking problem. It was one of those things that happened “suddenly” and “for no reason”.
Read the post: How Bad Cardinality Estimates Can Make Blocking Worse In SQL Server
You want your stored procedure to be a unit of work that you can roll back if something goes awry.
Read the post: How Explicit Transactions Can Make Blocking Worse In SQL Server
There are all sorts of fun hints you can staple onto your queries that will make them behave differently.
Read the post: Why Does Using The Rowlock Hint In SQL Server Create More Locks?
While working with a client who has a nasty blocking problem involving triggers, we were talking about using Snapshot Isolation to help fix the issue.
Read the post: Isolation Levels Are Inherited In SQL Server Queries
Most scripts (even ones I’ve worked on!) that look at the plan cache, have had the ability to sort it by different metrics: CPU, reads, writes, duration…
Read the post: Why Plan Cache Scripts For SQL Server Can Be Misleading
Sometimes, you only wanna work on one thing. Other times, you only wanna work on something if it’s not locked by something else.
Read the post: Why SQL Server’s READPAST Hint Doesn’t Always Work
sp_getapplock lets you take a lock on an imaginary resource, so you can serialize a section of code without locking any table or index.
But when I do, it’s usually to tell people they should use RCSI, and then disappear in a cloud of smoke.
Read the post: Lock Promotion In SQL Server Parallel Query Plans
Copyright © 2019-2026 Darling Data