Pros and cons of READ_COMMITTED_SNAPSHOT

后端 未结 1 813
我寻月下人不归
我寻月下人不归 2021-02-14 16:04

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

相关标签:
1条回答
  • 2021-02-14 16:56

    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
    0 讨论(0)
提交回复
热议问题