SQL SERVER 2012 XVELOCITY COLUMNSTORE INDEX Conor Cunningham Principal Architect SQL Server Engine.

Slides:



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

Parallel Query Processing in SQL Server Lubor Kollar.
OLAP Tuning. Outline OLAP 101 – Data warehouse architecture – ROLAP, MOLAP and HOLAP Data Cube – Star Schema and operations – The CUBE operator – Tuning.
Practical Caches COMP25212 cache 3. Learning Objectives To understand: –Additional Control Bits in Cache Lines –Cache Line Size Tradeoffs –Separate I&D.
Big Data Working with Terabytes in SQL Server Andrew Novick
EXECUTION PLANS By Nimesh Shah, Amit Bhawnani. Outline  What is execution plan  How are execution plans created  How to get an execution plan  Graphical.
High Performance Analytical Appliance MPP Database Server Platform for high performance Prebuilt appliance with HW & SW included and optimally configured.
Brian Babcock Surajit Chaudhuri Gautam Das at the 2003 ACM SIGMOD International Conference By Shashank Kamble Gnanoba.
1. Aim High with Oracle Real World Performance Andrew Holdsworth Director Real World Performance Group Server Technologies.
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)
Prof. Navneet Goyal Computer Science Department BITS, Pilani
Database Implementation Issues CPSC 315 – Programming Studio Spring 2008 Project 1, Lecture 5 Slides adapted from those used by Jennifer Welch.
Last Time –Main memory indexing (T trees) and a real system. –Optimize for CPU, space, and logging. But things have changed drastically! Hardware trend:
CS 300 – Lecture 20 Intro to Computer Architecture / Assembly Language Caches.
Advanced Querying OLAP Part 2. Context OLAP systems for supporting decision making. Components: –Dimensions with hierarchies, –Measures, –Aggregation.
Making Data Warehouse Easy Conor Cunningham – Principal Architect Thomas Kejser – Principal PM.
Fast Track, Microsoft SQL Server 2008 Parallel Data Warehouse and Traditional Data Warehouse Design BI Best Practices and Tuning for Scaling SQL Server.
1.
IST722 Data Warehousing Business Intelligence Development with SQL Server Analysis Services and Excel 2013 Michael A. Fudge, Jr.
Performance Tuning Cubes and Queries in Analysis Services 2008 Chris Webb
Best Practices for Data Warehousing. 2 Agenda – Best Practices for DW-BI Best Practices in Data Modeling Best Practices in ETL Best Practices in Reporting.
© Stavros Harizopoulos 2006 Performance Tradeoffs in Read-Optimized Databases Stavros Harizopoulos MIT CSAIL joint work with: Velen Liang, Daniel Abadi,
Review of Memory Management, Virtual Memory CS448.
CS 345: Topics in Data Warehousing Tuesday, October 19, 2004.
Physical Database Design & Performance. Optimizing for Query Performance For DBs with high retrieval traffic as compared to maintenance traffic, optimizing.
1 The Instant Data Warehouse Released 15/01/ Hello and Welcome!! Today I am very pleased to announce the release of the 'Instant Data Warehouse'.
Columnstore Indexes in SQL Server 2012 Conor Cunningham Principal Architect, Microsoft SQL Server Representing Microsoft Development.
Performance Tradeoffs in Read-Optimized Databases Stavros Harizopoulos * MIT CSAIL joint work with: Velen Liang, Daniel Abadi, and Sam Madden massachusetts.
The Memory Hierarchy 21/05/2009Lecture 32_CA&O_Engr Umbreen Sabir.
@ Carnegie Mellon Databases Inspector Joins Shimin Chen Phillip B. Gibbons Todd C. Mowry Anastassia Ailamaki 2 Carnegie Mellon University Intel Research.
Virtual Memory Expanding Memory Multiple Concurrent Processes.
© 2008 Quest Software, Inc. ALL RIGHTS RESERVED. Perfmon and Profiler 101.
BI Terminologies.
3-May-2006cse cache © DW Johnson and University of Washington1 Cache Memory CSE 410, Spring 2006 Computer Systems
Building Data and Document-Driven Decision Support Systems How do managers access and use large databases of historical and external facts?
TPC-H Studies Joe Chang
1 Biometric Databases. 2 Overview Problems associated with Biometric databases Some practical solutions Some existing DBMS.
Variant Indexes. Specialized Indexes? Data warehouses are large databases with data integrated from many independent sources. Queries are often complex.
Chapter 4 Logical & Physical Database Design
INTRODUCING SQL SERVER 2012 COLUMNSTORE INDEXES Exploring and Managing SQL Server 2012 Database Engine Improvements.
2012 © Trivadis BASEL BERN LAUSANNE ZÜRICH DÜSSELDORF FRANKFURT A.M. FREIBURG I.BR. HAMBURG MÜNCHEN STUTTGART WIEN Welcome November 2012 Columnstore Indexes.
IMS 4212: Database Implementation 1 Dr. Lawrence West, Management Dept., University of Central Florida Physical Database Implementation—Topics.
 An independent SQL Consultant  A user of SQL Server from version 2000 onwards with 12+ years experience.
Database Management Systems 3ed, R. Ramakrishnan and J. Gehrke1 Data Warehousing and Decision Support Chapter 25.
October 15-18, 2013 Charlotte, NC Accelerating Database Performance Using Compression Joseph D’Antoni, Solutions Architect Anexinet.
--A Gem of SQL Server 2012, particularly for Data Warehousing-- Present By Steven Wang.
1 Database Systems, 8 th Edition Star Schema Data modeling technique –Maps multidimensional decision support data into relational database Creates.
OM. Platinum Level Sponsors Gold Level Sponsors Pre Conference Sponsor Venue Sponsor Key Note Sponsor.
Doing fast! Optimizing Query performance with ColumnStore Indexes in SQL Server 2012 Margarita Naumova | SQL Master Academy.
Introduction to Partitioning in SQL Server
Cleveland SQL Saturday Catch-All or Sometimes Queries
Query Tuning without Production Data
Bolin Ding Silu Huang* Surajit Chaudhuri Kaushik Chakrabarti Chi Wang
Four Rules For Columnstore Query Performance
Blazing-Fast Performance:
Chapter 8: Main Memory.
The Key to the Database Engine
dbTouch: Analytics at your Fingertips
Enhance BI Applications and Simplify Development
Steve Hood SimpleSQLServer.com
TEMPDB – INTERNALS AND USAGE
(A Research Proposal for Optimizing DBMS on CMP)
Sunil Agarwal | Principal Program Manager
Four Rules For Columnstore Query Performance
CS-447– Computer Architecture Lecture 20 Cache Memories
Execution plans Eugene
Some of the slides are adopted from David Patterson (UCB)
Database Implementation Issues
Using Columnstore indexes in Azure DevOps Services. Lessons learned
Using Columnstore indexes in Azure DevOps Services. Lessons learned
Presentation transcript:

SQL SERVER 2012 XVELOCITY COLUMNSTORE INDEX Conor Cunningham Principal Architect SQL Server Engine

TODAY’S TALK Today we’re going to look “under the hood” on one of the key new features in SQL Server 2012 We will focus on ColumnStore indexes and how they are implemented For this talk, I am going to cover: How SQL Server executes queries using this index Why this functionality speeds performance Note: There are other talks on this index at SQLBits – they are all useful and focus on different parts of the technology

DATA WAREHOUSES INTRODUCTION What is a Data Warehouse? Data Warehouses are databases constructed in a special way They support reporting and business intelligence operations in organizations They are often BIG – lots of data Their size forces some tradeoffs and special use patterns Example: Show me the sales totals for each department in my company by month for the past 3 years

STAR SCHEMAS SaleDateSalesPersonItemNameSaleAmt BobPaper SallyPaper BobToner65.23 FactIDDateIDSalesPIDItemIDAmt DateIdDate SalesPIDName 1Bob 2Sally ItemIDName 1Paper 2Toner Raw Data “Fact” Table “Dimension” Tables

STAR JOIN PLANS Fact Tables are often BIG So big that indexing is often impractical You only want to scan it once per query SQL Server builds special query plans for aggregate queries over star schemas These are “Star Join” Plans Dim1 Dim2 Hash Join Dim3 Hash Join Fact Table Scan 1.Hash Joins 2.Dimensions First, then Scan Fact Table 3.Often Parallel

DATA WAREHOUSE PERFORMANCE DW Perf originally limited by IO Scan Speed Over time, IO speed got faster Many disks, faster interfaces Eventually DW Perf was CPU bound Even with Parallel Query, eventually you got stuck on the performance of the CPU Example – An analyst runs a BI report against SQL (ROLAP mode) Load Report Click on report to drill down Go get some coffee Click again Go get more coffee

WHAT IF… …We could make those report queries run ten times faster? …We changed the user paradigm from batch processing to an interactive experience? Businesses could navigate their data much more easily Everyone wins (…except perhaps coffee shops)

DEMO

HOW DOES IT WORK? Making something 10x faster is HARD Imagine making a car or a plane 10x faster Bugatti Veyron – 252 mph SR-71 Blackbird – 2070 mph If you DO happen to make it 10x faster, you’re likely not called a “car” or a “plane” anymore To build the xVelocity technology in ColumnStore, we had to do start over

HOW TO SPEED UP STORAGE AND IO How do we cut down IO by enough to get 10x overall speedup? Step 1: Column-Orientation Store data vertically instead of per-row Exploit that most Star Join Queries touch only some of the columns Step 2: Dictionaries for variable-length data Step 3: Compress Repeated Values Segment data into groups (1 million rows/group) Star Schemas have lots of repeated values Space savings of 1.5x-2x vs. a row-based page-compressed equivalent IO Patterns for (CI Scan, Column-based scan of 3 cols, Column-based w/Compression)

WHAT ELSE CAN WE DO? New systems are all 64-bit When compressed, sometimes (parts of) fact tables are starting to get small enough to fit into memory Memory gets exponentially cheaper over time So buy enough to fit that compressed fact table in memory We biased the memory management code to keep more data in memory in this scenario Now we can get the data into our star join potentially with no IO…

IMPROVING QUERY EXECUTION How do you make any program go 10x faster? Cut out 90% of the instructions? Unfortunately not… Buy 10x the number of processors? Maybe not… Throw out the book?

AN ASIDE…HOW CPUS WORK Level 3 Cache (Megabytes) Level 2 Cache (100s Kilobytes) Level 2 Cache (100s Kilobytes) L1 Data (32KB) CPU Core L1 Instr (32KB) Modern CPUs have Multiple Cores Cache Hierarchies: L1, L2, L3 Small L1 and L2 per core; L3 shared by all cores on die L1 is faster than L2, L2 faster than L3 CPUs can stall waiting for caches to load Level 2 Cache (100s Kilobytes) Level 2 Cache (100s Kilobytes) L1 Data (32KB) CPU Core L1 Instr (32KB) Time to Access Increases each level you need to touch!

KEY LESSONS Trend: CPUs speeds increase faster than memory Cost of going to next cache level goes up each year Code and Data both cause cache misses How you touch memory impacts program speed So we need to write programs to: Use fewer instructions Avoid cache misses We implemented a new execution model called “Batch Mode” The existing model is called “Row Mode”

HOW ROW MODE WORKS Each operator calls child for each row to “pull” the next row Works fine for smaller queries Often each operator transition causes L2 cache misses to load instructions/data When databases were new, the cost of IO was MUCH larger than CPU speed and this never mattered Now the equation has changed 15 Project Filter Table Scan GetRow()…(row returned)

BATCH MODEL Move from “pull” model to “push” Group rows into batches Re-use instructions while in cache Touch all “close” data in each operator This model reduces L2 cache misses It works best for queries with lots of rows being processed Project Filter Table Scan ProcessBatch()

BATCHES IN DETAIL Column-Oriented Sized to fit within L2 cache Reduce average per-tuple instruction cost Run-Length Compression Per Column Probabilistic data representations (in-row vs. out-of-row) Probabilistic operator execution algorithms (in- row first) This gets us to 10x+ faster (average) col1 col2 col3 col4 Per-row metadata Per-column metadata Batch

PERFORMANCE New model makes queries go a LOT faster However, not all queries get the benefits Data types: core types<=64 bits (CPU register size) Operators: Star Join Pattern (Join, Group By, Filter) Some restrictions we will relax over time If your application follows the star join pattern, you can get great speedups

CONCLUSION Please try out the new xVelocity ColumnStore Index It can give you significant performance improvements over prior technologies Thank You for Attending!

© 2011 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered trademarks and/or trademarks in the U.S. and/or other countries. The information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation. Because Microsoft must respond to changing market conditions, it should not be interpreted to be a commitment on the part of Microsoft, and Microsoft cannot guarantee the accuracy of any information provided after the date of this presentation. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.