120 likes | 309 Views
SQL Server 2005 Row Level Versioning. Roy Ernest Database Administrator Pinnacle Sports Worldwide royernest@yahoo.com. Contents. What is Row level Versioning How it works What uses it? Conclusion Costs of using RLV. What is Row Level Versioning.
E N D
SQL Server 2005Row Level Versioning Roy Ernest Database Administrator Pinnacle Sports Worldwide royernest@yahoo.com
Contents • What is Row level Versioning • How it works • What uses it? • Conclusion • Costs of using RLV Curaçao SQL Server User Group
What is Row Level Versioning • In Computing terms Version means a number indicating which revision something is. • Versioning works by making any transaction that changes data keep the old versions of the data around so that a 'snapshot' of the database (or a part of the database) can be constructed from these old versions. • Version records need to be kept in the version store only as long as there are there are operations that might require them. Curaçao SQL Server User Group
What it uses. • Snapshot Isolation (SI) • Read Committed Snapshot Isolation (RCSI) • These isolation levels let the Select get the previously committed value of the row without causing any blocking. Curaçao SQL Server User Group
How it works • SQL Server keeps previously committed value when it gets updated. • Chance of multiple versions of same row to be maintained. • Uses TempDB to store the versions. Curaçao SQL Server User Group
Test and see if it works. • Create a test DB • Set two Isolation Levels • Create test objects, data • Test the versioning Curaçao SQL Server User Group
What uses RLV Technology • Triggers • Online Index Creation • Multiple Active Result Sets Curaçao SQL Server User Group
Advantages of RLV • No Lock when Selecting • Select gives the last committed data • Decreases chances of Dead Lock • Lock Escalation is reduced • Not many locks used, thus reduces the load on Server Curaçao SQL Server User Group
Cost due to RLV • Since versions are kept, increased use of resources • Higher IO, CPU, Mem Usage when doing Updates and Deletes • TEMPDB must have more space to handle versions • 14 bytes will be added to the row in the DB to keep track of versions • Long version chain can affect Data read performance Curaçao SQL Server User Group
Conclusion Curaçao SQL Server User Group
Additional Resources • Technet http://technet.microsoft.com/en-us/library/ms189050.aspx • Article by Roy Ernest http://www.sqlservercentral.com/articles/SQL+Server+2005/62464/# Curaçao SQL Server User Group
DANKI! Curaçao SQL Server User Group