READ COMMITTED SNAPSHOT ISOLATION LEVEL IN SQL 2008

  • We are considering upgrading our existing SQL 2000 instances straight to SQL 2008 some time next year, and I wonder if there are any changes in the behavior of the READ COMMITTED SNAPSHOT ISOLATION LEVEL between SQL 2005 and SQL 2008.

    Also, if anyone has any positive/negative experiences to share from working with Read Committed Snapshot, please share here.

    __________________________________________________________________________________
    SQL Server 2016 Columnstore Index Enhancements - System Views for Disk-Based Tables[/url]
    Persisting SQL Server Index-Usage Statistics with MERGE[/url]
    Turbocharge Your Database Maintenance With Service Broker: Part 2[/url]

  • I'm not aware of any differences in behavior on READ COMMITTED SNAPSHOT. They did introduce the SNAPSHOT isolation level though. It's much more stringent and requires actual code changes to implement, so I doubt it's going to be terribly popular.

    As to stories... No, but we've only used it on small apps so far. More to come. Ask the same question in 6-9 months and I might have more war stories.

    "The credit belongs to the man who is actually in the arena, whose face is marred by dust and sweat and blood"
    - Theodore Roosevelt

    Author of:
    SQL Server Execution Plans
    SQL Server Query Performance Tuning

  • Grant Fritchey (12/4/2008)


    I'm not aware of any differences in behavior on READ COMMITTED SNAPSHOT. They did introduce the SNAPSHOT isolation level though. It's much more stringent and requires actual code changes to implement, so I doubt it's going to be terribly popular.

    As to stories... No, but we've only used it on small apps so far. More to come. Ask the same question in 6-9 months and I might have more war stories.

    Based on what I have read so far, READ COMMITTED SNAPSHOT seems like a very attractive option. The other SNAPSHOT ISOLATION concurrency level does seem to drastic to me though, so I wouldn't consider it. In our environment, much of the blocking and deadlocks involves readers and writers vying for a resource. READ COMMITTED SNAPSHOT promises to address that. I know tempdb utilization goes up when this isolation level is turned on, but I wonder if there are any other caveats to watch out for...

    Rolling it out gradually starting with small apps does seem like a sensible option.

    __________________________________________________________________________________
    SQL Server 2016 Columnstore Index Enhancements - System Views for Disk-Based Tables[/url]
    Persisting SQL Server Index-Usage Statistics with MERGE[/url]
    Turbocharge Your Database Maintenance With Service Broker: Part 2[/url]

  • Tempdb is the biggest cauion in the lot. You have to know that if the tempdb fills while dealing with READ COMMITTED SNAPSHOT, then the read's against the data aren't simply blocked, they start returning errors. So you really need to manage tempdb well when you adopt this approach. I haven't seen it, again, my db's are still small, but I understand that you can see performance impacts when the processes that would normally read straight from a table/index/heap have to also scan and marshal data out of the tempdb. This can be more costly than the savings from not having to wait on the locks to clear.

    Those are the only ones I'm aware of at this point. I'm sure there are others.

    "The credit belongs to the man who is actually in the arena, whose face is marred by dust and sweat and blood"
    - Theodore Roosevelt

    Author of:
    SQL Server Execution Plans
    SQL Server Query Performance Tuning

  • Grant Fritchey (12/4/2008)


    Tempdb is the biggest cauion in the lot. You have to know that if the tempdb fills while dealing with READ COMMITTED SNAPSHOT, then the read's against the data aren't simply blocked, they start returning errors. So you really need to manage tempdb well when you adopt this approach. I haven't seen it, again, my db's are still small, but I understand that you can see performance impacts when the processes that would normally read straight from a table/index/heap have to also scan and marshal data out of the tempdb. This can be more costly than the savings from not having to wait on the locks to clear.

    Those are the only ones I'm aware of at this point. I'm sure there are others.

    Yes, I'm reading that there is performance impact on both updates and reads because of the extra work required. The question is whether this impact outweighs the benefit of less blocking. That's a tough one to determine.

    I'm also getting the feeling that keeping transactions short is even more critical here than in the default isolation-level situation.

    __________________________________________________________________________________
    SQL Server 2016 Columnstore Index Enhancements - System Views for Disk-Based Tables[/url]
    Persisting SQL Server Index-Usage Statistics with MERGE[/url]
    Turbocharge Your Database Maintenance With Service Broker: Part 2[/url]

  • A few more things to consider with any isolation level that uses the version store (BTW, the following points are taken from INSIDE MICROSOFT SQL SERVER 2005: THE STORAGE ENGINE by Kalen Delaney, Solid Quality Learning):

    (1) any row inserted or updated in a database in which a version-store isolation level is enabled will have an extra 14 bytes to contain pointer information in the linked list of row versions kept in the version store.

    That can add up pretty fast in large databases.

    (2) updates are done as a delete and an insert, meaning that simple updates can cause page splitting.

    Some advantages with optimistic concurrency isolation levels: snapshot isolation (SI) and read-committed snapshot isolation (RCSI):

    (3) RCSI works with distributed transactions.

    (4) The total number of locks needed is drastically reduced compared to pessimistic concurrency, so less system overhead is used.

    (5) Fewer lock escalations are needed

    (6) Deadlocks less likely to occur.

    __________________________________________________________________________________
    SQL Server 2016 Columnstore Index Enhancements - System Views for Disk-Based Tables[/url]
    Persisting SQL Server Index-Usage Statistics with MERGE[/url]
    Turbocharge Your Database Maintenance With Service Broker: Part 2[/url]

  • It's 4,5,and 6 that we're going for, paying for them with 1,2 and 3 and the other things already mentioned on this thread because, after all, TANSTAAFL.

    "The credit belongs to the man who is actually in the arena, whose face is marred by dust and sweat and blood"
    - Theodore Roosevelt

    Author of:
    SQL Server Execution Plans
    SQL Server Query Performance Tuning

  • Grant Fritchey (12/5/2008)


    It's 4,5,and 6 that we're going for, paying for them with 1,2 and 3 and the other things already mentioned on this thread because, after all, TANSTAAFL.

    What is it that made you guys do this? Is there a lot of blocking/deadlocks in your system?

    I'm just curious what makes people switch from the default isolation level to see if it makes sense for us to do the same.

    __________________________________________________________________________________
    SQL Server 2016 Columnstore Index Enhancements - System Views for Disk-Based Tables[/url]
    Persisting SQL Server Index-Usage Statistics with MERGE[/url]
    Turbocharge Your Database Maintenance With Service Broker: Part 2[/url]

  • I've got two systems that we're trying it out on. The first one was getting lots of deadlocks. We know why, but we're not allowed to modify the code... Don't ask.

    The other system is under development. It's being completely developed as an Object Oriented (or designed, I'm not sure what the correct term is) database built out of nHibernate using only nHibernate for data access. I'm just assuming it's going to do heinous acts to the database so I'm trying to minimize the damage caused. It's still an experiment at this stage.

    "The credit belongs to the man who is actually in the arena, whose face is marred by dust and sweat and blood"
    - Theodore Roosevelt

    Author of:
    SQL Server Execution Plans
    SQL Server Query Performance Tuning

  • Grant Fritchey (12/5/2008)


    I've got two systems that we're trying it out on. The first one was getting lots of deadlocks. We know why, but we're not allowed to modify the code... Don't ask.

    The other system is under development. It's being completely developed as an Object Oriented (or designed, I'm not sure what the correct term is) database built out of nHibernate using only nHibernate for data access. I'm just assuming it's going to do heinous acts to the database so I'm trying to minimize the damage caused. It's still an experiment at this stage.

    I see, thanks for sharing.

    __________________________________________________________________________________
    SQL Server 2016 Columnstore Index Enhancements - System Views for Disk-Based Tables[/url]
    Persisting SQL Server Index-Usage Statistics with MERGE[/url]
    Turbocharge Your Database Maintenance With Service Broker: Part 2[/url]

Viewing 10 posts - 1 through 10 (of 10 total)

You must be logged in to reply to this topic. Login to reply