Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Pros and cons of READ_COMMITTED_SNAPSHOT

What are the pros and cons of setting READ_COMMITTED_SNAPSHOT ON in SQL server 2008?

Actually i was running through the the problem of transaction deadlockS, but by setting READ_COMMITTED_SNAPSHOT ON on and disabling the Lock Escalation (only on table that used in transactions that causing deadlock). This finished the problem of deadlock by about 90%; but i am worried it might have some other problems like performance etc.

Any help will be highly appreciated.

like image 590
yo chauhan Avatar asked Jun 04 '12 02:06

yo chauhan


1 Answers

Benefits of RCSI:

  • provides a consistent view of the data at the time the query started
  • no blocking
  • fewer locks / escalations

This isn't free, however; tempdb is used to keep what it calls a "version store." Which can mean:

  • space & I/O requirements for tempdb increase to maintain versions
  • potential performance degradation if long-running transactions require versions to be held for long periods and/or if many versions exist

Also, row version information adds 14 bytes per row.

Common alternatives to RCSI usually involve splitting up the write activity from reporting. This can be done with various HA technologies such as log shipping, mirroring + snapshots, or Availability Groups + read-only secondaries in SQL Server 2012.

Some official doc references:

  • Working with tempdb in SQL Server 2005
  • Choosing Row Versioning-based Isolation Levels
like image 196
Aaron Bertrand Avatar answered Nov 20 '22 19:11

Aaron Bertrand