sql server compression
DESCRIPTION
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.TRANSCRIPT
Warwick Rudd
Microsoft Certified Master (MCM) – SQL 2008
Principal Consultant
@Warwick_Rudd
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
History of Compression
SQL Server Database Compression
SQL Server Backup Compression
Compression Estimation Tool
The reduction in size of data to save space or processing time.
SQL Server 2005 SP2
•New Data Type - VarDecimal
SQL Server 2008
•Database & Backup compression
SQL Server 2008 R2
•Unicode data compression
SQL Server 2005 SP2 SQL Server 2008 SQL Server 2008 R2
Edition Enterprise Enterprise Enterprise & Data Center
Compression Type
VarDecimal
Row Level
Page Level
Unicode
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
SQL Server 2005 SP2
• Sys.sp_estimated_rowsize_reduction_for_vardecimal
SQL Server 2008 & R2
• Sp_estimate_data_compression_savings
SQL Server 2005 SP2
• Enable database for Vardecimal Storage Format
• Sp_db_vardecimal_storage_format
• Enabling table for Vardecimal storage format
• Sp_tableoption
SQL Server 2008 & R2
• Alter table [TableName] Rebuild With (Data_Compression = Compression Type)
• Alter table [TableName] Rebuild Partition = All With (Data_Compression = Compression Type on Partitions (x to n))
• Alter Index [IndexName] on [TableName] Rebuild With (Data_Compression = Compression Type)
• Compression Types (Row, Page, None)
Data Types 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
SQL Server 2005 SP2 SQL Server 2008 SQL Server 2008 R2
Edition
Standard
Enterprise
Data Center
Benefits Cost
Performance Improvements Increased CPU utilisation
• Reduce I/O
Reduced disk space usage
Reduced time to backup
Cost Savings
Instance Level
•SSMS
•Transact SQL
Defaults can be overridden
•Transaction Log Shipping
•Maintenance Plans
•SSMS
•Transact SQL
Available from Codeplex
• http://ssce.codeplex.com/
http://blogs.msdn.com/b/sqlserverstorageengine/archive/tags/data+compression/
http://msdn.microsoft.com/en-us/library/dd894051(v=sql.100).aspx#_Appendix_C:_Script
http://msdn.microsoft.com/en-us/library/cc280576.aspx
http://msdn.microsoft.com/en-us/library/cc280464.aspx
www.sqlmastersconsulting.com.au