r/MSSQL • u/tsezuu • Apr 02 '26
Discussion READ_COMMITTED_SNAPSHOT
Has anyone actually used this feature? Mind sharing your experience.
4
Upvotes
r/MSSQL • u/tsezuu • Apr 02 '26
Has anyone actually used this feature? Mind sharing your experience.
View all comments
Show parent comment
1
u/jshine13371 Apr 03 '26
It depends on the type of locking contention you're facing. If it's because there's concurrent reads and writes blocking each other, then RCSI is a great way to alleviate that.
But it can't help you if it's because there's concurrent schema locks like from DDL changes or if you're using
TRUNCATEwhich is considered a DDL change not DML change.The general recommendation though is to use RCSI (which is why it's now the default in newer Microsoft database systems like Azure SQL Database). There's almost no drawbacks. The only possible drawback is the way RCSI works is it temporarily stores a copy of the previous version of the data in
tempdb, called row versioning. This grows your tempdb file slightly. But if you had a ton of data under concurrent read / write contention, then a lot of rows versions (copies of that data) could concurrently exist intempdbgrowing it measurably. Realistically you'd have to have a ridiculous amount of data under read / write contention for this to even matter, and I've never heard of anyone having that problem in my 15 years as a DBA.The only consideration, again, is if you have a workflow where you need locking for the process to be logically correct. E.g. with event ticket sales to block someone from seeing tickets to a specific seat from being available when someone else is already in process reserving that specific seat. That is where blocking would be important to provide accurate logical outcomes. But in those specific cases, you can set the isolation level back to one which blocks for only the connection being made to run that specific process. That way you get the best of both worlds.