sql server compression

19
Warwick Rudd Microsoft Certified Master (MCM) – SQL 2008 Principal Consultant [email protected] @Warwick_Rudd

Upload: warwick-rudd

Post on 03-Jul-2015

111 views

Category:

Data & Analytics


0 download

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

Page 1: Sql server compression

Warwick Rudd

Microsoft Certified Master (MCM) – SQL 2008

Principal Consultant

[email protected]

@Warwick_Rudd

Page 2: Sql server compression

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

Page 3: Sql server compression

History of Compression

SQL Server Database Compression

SQL Server Backup Compression

Compression Estimation Tool

Page 4: Sql server compression

The reduction in size of data to save space or processing time.

Page 5: Sql server 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

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

Page 7: Sql server compression

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

Page 8: Sql server compression

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

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)

Page 10: Sql server compression

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

Page 11: Sql server compression
Page 12: Sql server compression

SQL Server 2005 SP2 SQL Server 2008 SQL Server 2008 R2

Edition

Standard

Enterprise

Data Center

Page 13: Sql server compression

Benefits Cost

Performance Improvements Increased CPU utilisation

• Reduce I/O

Reduced disk space usage

Reduced time to backup

Cost Savings

Page 14: Sql server compression

Instance Level

•SSMS

•Transact SQL

Defaults can be overridden

•Transaction Log Shipping

•Maintenance Plans

•SSMS

•Transact SQL

Page 15: Sql server compression
Page 16: Sql server compression

Available from Codeplex

• http://ssce.codeplex.com/

Page 17: Sql server compression
Page 18: Sql server compression

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

Page 19: Sql server compression

www.sqlmastersconsulting.com.au