Database & Backup compression was introduced gradually into SQL Server starting from SQL Server 2005 SP2. In this presentation Warwick takes you through the history of compression in SQL Server, the different version capabilities, taking you through how you can enable the various compression types and rounds out with introducing the compression estimation tool that is available on codeplex.
2. About Me : Warwick Rudd
• SQL Server Consultant
• MCM – SQL Server 2008
• MCSM – Data Platform
• Certified Trainer
• Reviewed 4 SQL Server 2012 Beta Exams
• Blogger on Simpletalk.com
• Presenter at:
• User Groups
• SQLSaturdays
• TechED Australia
3. History of Compression
SQL Server Database Compression
SQL Server Backup Compression
Compression EstimationTool
5. SQL Server 2005 SP2
• New DataType -VarDecimal
SQL Server 2008
• Database & Backup compression
SQL Server 2008 R2
• Unicode data compression
6. SQL Server 2005 SP2 SQL Server 2008 SQL Server 2008 R2
Edition Enterprise Enterprise Enterprise &
Data Center
CompressionType
VarDecimal
Row Level
Page Level
Unicode
7. Benefits Cost
Performance Improvements Increased CPU utilisation
• More data in memory
• Reduce I/O
Reduced disk space usage
• Database data files
• Backup files
Reduced time to backup
Cost Savings
8. SQL Server 2005 SP2
• Sys.sp_estimated_rowsize_reduction_for_vardecimal
SQL Server 2008 & R2
• Sp_estimate_data_compression_savings
9. SQL Server 2005 SP2
• Enable database forVardecimal Storage Format
• Sp_db_vardecimal_storage_format
• Enabling table forVardecimal storage format
• Sp_tableoption
SQL Server 2008 & R2
• Alter table [TableName] Rebuild With (Data_Compression = CompressionType)
• Alter table [TableName] Rebuild Partition = AllWith (Data_Compression = CompressionType on Partitions (x to n))
• Alter Index [IndexName] on [TableName] RebuildWith (Data_Compression = CompressionType)
• CompressionTypes (Row, Page, None)
10. DataTypes not able to be compressed
• XML
• BLOB
• MAX Datatypes
Tables not eligible for compression
• Maximum row size + compression overhead > 8060 bytes
Compression with Partitions
• Splitting a range
• Merging a range
• Switching a range
11.
12. SQL Server 2005 SP2 SQL Server 2008 SQL Server 2008 R2
Edition
Standard
Enterprise
Data Center