SQL Server - Dirty Reads Pros & Cons

前端 未结 4 1272
慢半拍i
慢半拍i 2020-12-11 03:21

Why should I or shouldn\'t I use dirty reads:

set transaction isolation level read uncommitted

in SQL Server?

4条回答
  •  心在旅途
    2020-12-11 03:42

    Generally when you need to do a sizeable (or frequent) queries to busy tables, where read committed would possibly be blocked by locks from uncommited transactions, but ONLY when you can live with inaccurate data.

    As an example, on a gaming web site I worked on recently there was a summary display of some stats about recent games, this was all based on dirty reads, it was more important for us to include then exclude the transactional data not yet committed (we knew anyway that few, if any, transactions would be backed out), we felt that on average the data would be more accurate that way.

提交回复
热议问题