sql server compression estimation
DESCRIPTION
SQL Server Compression Estimation. Presented by Warwick Rudd – [email protected]. About Warwick Rudd. SQL Server Consultant WARDY IT Solutions Email: [email protected] Microsoft Certified IT Professional – SQL 2008 Admin (MCITP SQL 2008 Admin) - PowerPoint PPT PresentationTRANSCRIPT
![Page 2: SQL Server Compression Estimation](https://reader035.vdocuments.net/reader035/viewer/2022062520/568161e0550346895dd1f31d/html5/thumbnails/2.jpg)
About Warwick Rudd
• SQL Server Consultant WARDY IT Solutions – Email: [email protected]
• Microsoft Certified IT Professional – SQL 2008 Admin (MCITP SQL 2008 Admin)
• Microsoft Certified Trainer (MCT)• WARDY IT Solutions
– Australia’s leading SQL Server specialists– Deloitte Technology Fast 500 Asia Pacific 2010 Winner
![Page 3: SQL Server Compression Estimation](https://reader035.vdocuments.net/reader035/viewer/2022062520/568161e0550346895dd1f31d/html5/thumbnails/3.jpg)
Contents
• History of Compression• SQL Server Database Compression• SQL Server Backup Compression• Compression Estimation Tool
![Page 4: SQL Server Compression Estimation](https://reader035.vdocuments.net/reader035/viewer/2022062520/568161e0550346895dd1f31d/html5/thumbnails/4.jpg)
What is Compression ?
The reduction in size of data to save space or processing time.
![Page 5: SQL Server Compression Estimation](https://reader035.vdocuments.net/reader035/viewer/2022062520/568161e0550346895dd1f31d/html5/thumbnails/5.jpg)
History of Compression
• SQL Server 2005 SP2– New Data type - VarDecimal
• SQL Server 2008 – Database & Backup compression
• SQL Server 2008 R2– Unicode data compression
![Page 6: SQL Server Compression Estimation](https://reader035.vdocuments.net/reader035/viewer/2022062520/568161e0550346895dd1f31d/html5/thumbnails/6.jpg)
Database Compression MatrixSQL Server 2005 SP2
SQL Server 2008
SQL Server 2008 R2
Edition Enterprise Enterprise Enterprise & Data Center
Compression Type
VarDecimal Row Level Page Level Unicode
![Page 7: SQL Server Compression Estimation](https://reader035.vdocuments.net/reader035/viewer/2022062520/568161e0550346895dd1f31d/html5/thumbnails/7.jpg)
Database Compression Cost Benefit Analysis
Benefits CostPerformance improvements Increased CPU utilisation
• More data in memory
• Reduced I/O
Reduced disk space usage
• Database data files
• Backup files
Reduced time to backup
Cost Savings
![Page 8: SQL Server Compression Estimation](https://reader035.vdocuments.net/reader035/viewer/2022062520/568161e0550346895dd1f31d/html5/thumbnails/8.jpg)
Database Compression Estimation
• SQL Server 2005 SP2– Sys.sp_estimated_rowsize_reduction_for_vardecimal
• SQL Server 2008 & R2– Sp_estimate_data_compression_savings
![Page 9: SQL Server Compression Estimation](https://reader035.vdocuments.net/reader035/viewer/2022062520/568161e0550346895dd1f31d/html5/thumbnails/9.jpg)
Enabling Database Compression
• 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)• Compression Types
– Row– Page– None
![Page 10: SQL Server Compression Estimation](https://reader035.vdocuments.net/reader035/viewer/2022062520/568161e0550346895dd1f31d/html5/thumbnails/10.jpg)
Enabling Database Compression– Alter Table [TableName] Rebuild Partition = All with
(Data_compression = Compression Type on Partitions (x to n))
• Compression Types– Row– Page– None
– Alter Index [IndexName] on [TableName] Rebuild with (Data_compression = Compression Type)
• Compression Types– Row– Page– None
![Page 11: SQL Server Compression Estimation](https://reader035.vdocuments.net/reader035/viewer/2022062520/568161e0550346895dd1f31d/html5/thumbnails/11.jpg)
Things to consider
• Data types not able to be compressed– XML– BLOB– MAX Datatypes
• Tables not eligible for compression– Maximum row size + compression overhead >
8060 bytes
![Page 12: SQL Server Compression Estimation](https://reader035.vdocuments.net/reader035/viewer/2022062520/568161e0550346895dd1f31d/html5/thumbnails/12.jpg)
Things to consider
• Compression with partitions– Splitting a range– Merging a range– Switching partitions
![Page 13: SQL Server Compression Estimation](https://reader035.vdocuments.net/reader035/viewer/2022062520/568161e0550346895dd1f31d/html5/thumbnails/13.jpg)
SQL Server Database Compression Demo
![Page 14: SQL Server Compression Estimation](https://reader035.vdocuments.net/reader035/viewer/2022062520/568161e0550346895dd1f31d/html5/thumbnails/14.jpg)
Backup Compression MatrixSQL Server 2005 SP2
SQL Server 2008
SQL Server 2008 R2
EditionStandard Enterprise Datacenter
![Page 15: SQL Server Compression Estimation](https://reader035.vdocuments.net/reader035/viewer/2022062520/568161e0550346895dd1f31d/html5/thumbnails/15.jpg)
Backup Compression Cost Benefit Analysis
Benefits CostPerformance improvements Increased CPU utilisation
• Reduced I/O
Reduced disk space usage
Reduced time to backup
Cost Savings
![Page 16: SQL Server Compression Estimation](https://reader035.vdocuments.net/reader035/viewer/2022062520/568161e0550346895dd1f31d/html5/thumbnails/16.jpg)
Enabling Backup Compression
• Instance level– SSMS– Transact SQL
• Defaults can be overidden– Transaction Log Shipping– Maintenance Plans– SSMS– Transact SQL
![Page 17: SQL Server Compression Estimation](https://reader035.vdocuments.net/reader035/viewer/2022062520/568161e0550346895dd1f31d/html5/thumbnails/17.jpg)
SQL Server Backup Compression Demo
![Page 18: SQL Server Compression Estimation](https://reader035.vdocuments.net/reader035/viewer/2022062520/568161e0550346895dd1f31d/html5/thumbnails/18.jpg)
Compression Estimation Tool
• Available from Codeplex– http://ssce.codeplex.com/
![Page 19: SQL Server Compression Estimation](https://reader035.vdocuments.net/reader035/viewer/2022062520/568161e0550346895dd1f31d/html5/thumbnails/19.jpg)
Compression Estimation Tool Demo
![Page 21: SQL Server Compression Estimation](https://reader035.vdocuments.net/reader035/viewer/2022062520/568161e0550346895dd1f31d/html5/thumbnails/21.jpg)
Other Resources• http://blogs.msdn.com/b/sqlserverstorageengine/archive/tags/da
ta+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