80 likes | 283 Views
Optimistic Concurrency Internals. James Rowland-Jones @ jrowlandjones. What we will cover in the next hour. Concurrency Basics Flavours of Optimistic Concurrency The Internals. “the ability of multiple processes to act on the same data at the same time”. Concurrency.
E N D
Optimistic Concurrency Internals James Rowland-Jones @jrowlandjones
What we will cover in the next hour • Concurrency Basics • Flavours of Optimistic Concurrency • The Internals
“the ability of multiple processes to act on the same data at the same time” Concurrency
Read Committed Snapshot Isolation • Essentially same isolation level as Read Committed in Pessimistic Mode • No shared locks when reading data • Once set - default transaction isolation level for that SQL Server database. • The data that the user can read is the data provided at the time the statement inside the transaction starts.
Snapshot Isolation • Completely New Isolation Level • Designed for Higher degrees of Isolation level than RCSI • Not Good if concurrent Updates are occurring • Fair number of restrictions
Row Versioning • Used to implement • Online Index Rebuilds • Triggers (inserted and deleted tables use row versioning) • MARS • Prior to updating a row SQL Server copies the row and stores it in the version store • Held till no longer required • Marked by the Transaction ID of the row that caused its creation • Writers bear the brunt of the cost for setting up the version • Readers pay navigating pointer chains • BLOBs aren’t moved into the version store in their entirety • Only fragment that was changed is held.