October 15-18, 2013 Charlotte, NC Accelerating Database Performance Using Compression Joseph D’Antoni, Solutions Architect Anexinet.

Slides:



Advertisements
Similar presentations
Adam Jorgensen Pragmatic Works Performance Optimization in SQL Server Analysis Services 2008.
Advertisements

<Insert Picture Here>
SQL SERVER 2012 XVELOCITY COLUMNSTORE INDEX Conor Cunningham Principal Architect SQL Server Engine.
SQL Server Compression Estimation Presented by Warwick Rudd –
Dos and don’ts of Columnstore indexes The basis of xVelocity in-memory technology What’s it all about The compression methods (RLE / Dictionary encoding)
Project Management Database and SQL Server Katmai New Features Qingsong Yao
Tables Lesson 6. Skills Matrix Tables Tables store data. Tables are relational –They store data organized as row and columns. –Data can be retrieved.
Harvard University Oracle Database Administration Session 2 System Level.
Harvard University Oracle Database Administration Session 5 Data Storage.
André Kamman Friday November 20 SQLBITS IV. About Me  André Kamman  > 20 years in IT  Main focus on complex SQL Server environments (or a whole.
SQL Server 2008: What to do and What not to do Eladio Rincón Javier Loria Solid.
CHAPTER 11 Large Objects. Need for Large Objects Data type to store objects that contain large amount of text, log, image, video, or audio data. Most.
Troubleshooting SQL Server Enterprise Geodatabase Performance Issues
Chapter Oracle Server An Oracle Server consists of an Oracle database (stored data, control and log files.) The Server will support SQL to define.
Sofia, Bulgaria | 9-10 October SQL Server 2005 High Availability for developers Vladimir Tchalkov Crossroad Ltd. Vladimir Tchalkov Crossroad Ltd.
Extents, segments and blocks in detail. Database structure Database Table spaces Segment Extent Oracle block O/S block Data file logical physical.
TEMPDB Capacity Planning. Indexing Advantages – Increases performance – SQL server do not have to search all the rows. – Performance, Concurrency, Required.
Oracle Advanced Compression – Reduce Storage, Reduce Costs, Increase Performance Session: S Gregg Christman -- Senior Product Manager Vineet Marwah.
1099 Why Use InterBase? Bill Todd The Database Group, Inc.
Page 1 SQL Server Myths XV ENCONTRO DA COMUNIDADE SQLPORT Rui Ribeiro MCITP 2011/08/16.
Module 16: Performing Ongoing Database Maintenance
1 CS 430 Database Theory Winter 2005 Lecture 16: Inside a DBMS.
Database structure and space Management. Database Structure An ORACLE database has both a physical and logical structure. By separating physical and logical.
DMBS Internals I. What Should a DBMS Do? Store large amounts of data Process queries efficiently Allow multiple users to access the database concurrently.
SQLintersection Putting the "Squeeze" on Large Tables Improve Performance and Save Space with Data Compression Justin Randall Tuesday,
Chapter 4 Indexes. Index Architecture  By default data is inserted on a first-come, first-serve basis  Indexes bring order to this chaos  Once you.
Roy Ernest Database Administrator Pinnacle Sports Worldwide
SQLintersection Understanding Transaction Isolation Levels Randy Knight Wednesday, 3:45-5:00.
DMBS Internals I. What Should a DBMS Do? Store large amounts of data Process queries efficiently Allow multiple users to access the database concurrently.
CS4432: Database Systems II
5 Trends in the Data Warehousing Space Source: TDWI Report – Next Generation DW.
How to kill SQL Server Performance Håkan Winther.
October 15-18, 2013 Charlotte, NC SQL Server Index Internals Tim Chapman Premier Field Engineer.
Scott Fallen Sales Engineer, SQL Sentry Blog: scottfallen.blogspot.com.
What Should a DBMS Do? Store large amounts of data Process queries efficiently Allow multiple users to access the database concurrently and safely. Provide.
Does the Optimistic Concurrency resolve your blocking problems Margarita Naumova, SQL Master Academy.
Database Administration for the Non-DBA Denny Cherry twitter.com/mrdenny.
Doing fast! Optimizing Query performance with ColumnStore Indexes in SQL Server 2012 Margarita Naumova | SQL Master Academy.
Best Practices for Columnstore Indexes Warner Chaves SQL MCM / MVP SQLTurbo.com Pythian.com.
Indexing strategies and good physical designs for performance tuning Kenneth Ureña /SpanishPASSVC.
Indexes By Adrienne Watt.
What Is a Latch? …and Why Do I Care? Eddie Wuerch, mcm
Hitting the SQL Server “Go Faster” Button
Very Large Databases in your future
Finding more space for your tight environment
Inside of SQL Server Indexes
Designing Database Solutions for SQL Server
Introduction to SQL Server Management for the Non-DBA
Four Rules For Columnstore Query Performance
Database Administration for the Non-DBA
Blazing-Fast Performance:
Working with Very Large Tables Like a Pro in SQL Server 2014
Hitting the SQL Server “Go Faster” Button
Real world In-Memory OLTP
SQL 2014 In-Memory OLTP What, Why, and How
What Is a Latch? …and Why Do I Care? Eddie Wuerch, mcm
Squeeze Into Some Free Gains
Very large Databases in your future Eric Peterson.
TEMPDB – INTERNALS AND USAGE
Selected Topics: External Sorting, Join Algorithms, …
In Memory OLTP Not Just for OLTP.
Understanding Transaction Isolation Levels
Adding Lightness Better Performance through Compression
It’s TEMPDB Why Should You Care?
Four Rules For Columnstore Query Performance
Clustered Columnstore Indexes (SQL Server 2014)
Squeeze Into Some Free Gains
Using Columnstore indexes in Azure DevOps Services. Lessons learned
Using Columnstore indexes in Azure DevOps Services. Lessons learned
Sunil Agarwal | Principal Program Manager
Presentation transcript:

October 15-18, 2013 Charlotte, NC Accelerating Database Performance Using Compression Joseph D’Antoni, Solutions Architect Anexinet

October 15-18, 2013 | Charlotte, NC Please silence cell phones

About – Twitter Joedantoni.wordpress.com -- Blog -- Bit.ly/SQLCompression – Presentation Resources

Overview Compression—Tell me More? Deduplication—What is That? What Data Should I Compress? Columnstore—How Is It Different?

Compression the Early Years

Why Compression Now?

What is (Data) Compression?.jpg.mp4

Deduplication Specialized compression to eliminate duplicate copies of repeating data Real Example—In VMWare, you may have 10 copies of Windows running on same physical machine. Memory blocks (Common.dlls for example) may be deduplicated. Exchange Attachments Backup Appliances

Compression Benefits

So What are the Benefits of Compression? Faster performance on selects Less I/O is required to return data Better Space Utilization on Disk More Rows In Memory

Expenses of Compression

Moderately Slower Single Row Updates/Inserts More expensive (slower) bulk updates and inserts

SQL Server Compression Types Row Compression Page Compression Prefix Compression Dictionary Compression Backup Compression

Row Compression Treats fixed length datatypes like variable datatypes

Page Compression Page Before Compression Prefix Compression Dictionary Compression Images Courtesy SQL Server Books Online

Partitioning and Compression

Backup Compression In all editions of SQL Server, starting with 2008 R2 Always use Backup Compression (even when your storage team says no) Space is by default pre-allocated for estimated size of uncompressed backup Trace Flag 3042

How Does Compression Work? Storage Engine compresses and decompresses data No other parts of SQL Server need to understand compression Application code doesn’t need to change

So What Objects Should We Compress? SQL Data Compression gives a great deal of flexibility Can compress tables, indexes and/or partition(s) Can use different methods of compression for each How to Decide?

October 15-18, 2013 | Charlotte, NC Deciding What to Compress 1.Start with Space Savings 2.Check Update Percentage 3.Check Scan Percentage 4.Map it out and decide

Space Savings sp_estimate_data_compression_savings What Won’t Compress Well Columns with numeric or fixed-length character data types where most values require all the bytes allocated for the specific data type Not much repeating data Repeating data with non-repeating prefixes Data stored out of the row FILESTREAM data

Application Workloads Microsoft Recommendation: Page Compression has higher overhead than Row Compression Evaluate where to use page compression carefully If row compression results in space savings and the system can accommodate a 10 percent increase in CPU usage, all data should be row-compressed.

Example - source Microsoft Compression White Paper Table Name Savings ROW % Savings PAGE % ScansUpdatesDecisionNotes Table 1 Employees 80%90%3.80%57.27%ROW Low S, very high U. ROW savings close to PAGE Table 2 HR 15%89%92.46%0%PAGE Very high S Table 3 Salary 30%81%27.14%4.17%ROW Low S Table 4 Vendors 38%83%89.16%10.54%ROW High U Table 5 Sales Order 21%87%0.00%0%PAGE Append ONLY table Table 1: Deciding what to compress

What Happens When We Compress and Object? Tables and Indexes are rebuilt using ALTER TABLE…REBUILD and ALTER INDEX..REBUILD Requires workspace, CPU and I/O Same mechanism as rebuilding an index Free workspace required in User Database Transaction Log Temp DB

How and When Compress Data Online vs Offline Concurrent vs Serial Order of Compressing—start small and work up SORT_IN_TEMPDB

How SQL Manages Inserts and Updates with Compresison Table organization Table compression setting ROW CompressionPAGE Compression HeapThe newly inserted row is row-compressed. The newly inserted row is page-compressed: · if new row goes to an existing page with page compression · if the new row is inserted through BULK INSERT with TABLOCK · if the new row is inserted through INSERT INTO... (TABLOCK) SELECT... FROM Otherwise, the row is row- compressed.* Clustered indexThe newly inserted row is row-compressed. The newly inserted row is page-compressed if new row goes to an existing page with page compression Otherwise, it is row compressed until the page fills up. Page compression is attempted before a page split.**

What Happens to SQL Server’s Underlying Data Structures? Table compression Transaction log Mapping index for rebuilding the clustered index Sort pages for queries Version store (with SI or RCSI isolation level) ROW NONE ROW PAGEROWNONE ROW

What is Columnstore?

ColumnStore Architecture Column Segments Contains records from one for multiple rows Row Groups Segments that contain the same set of rows make a row group Segments are compressed Each segment is stored as its own LOB. Segment is unit of movement from disk into memory Row Group Column Segment

ColumnStore Limitations Non-Updateable (2012) Limited Data Types Can only be nonclustered index (2012) No computed columns No sparse columns No indexed views One Per Table

Columnstore in SQL 2014 Fewer Data Type Limitations Updateable Can be Clustered Index New Archival Compression Mode

Columnstore Updates (2014) Updates To Index Collected until they reach 1000 rows Tuple Movers Move into Index

Compression Demo

Questions

Contact – Twitter – Joedantoni.wordpress.com – Blog Bit.ly/SQLCompression – Presentation Resources