Clustered Columnstore Indexes (SQL Server 2014)

Slides:



Advertisements
Similar presentations
Big Data Working with Terabytes in SQL Server Andrew Novick
Advertisements

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)
Module 6 Implementing Table Structures in SQL Server ®2008 R2.
Oracle Database Administration Database files Logical database structures.
Oracle Data Block Oracle Concepts Manual. Oracle Rows Oracle Concepts Manual.
Oracle9i Database Administrator: Implementation and Administration 1 Chapter 9 Index Management.
Architecture Rajesh. Components of Database Engine.
SQL Server Indexes Indexes. Overview Indexes are used to help speed search results in a database. A careful use of indexes can greatly improve search.
Table Indexing for the.NET Developer Denny Cherry twitter.com/mrdenny.
Denny Cherry twitter.com/mrdenny.
T-SQL: Simple Changes That Go a Long Way DAVE ingeniousSQL.com linkedin.com/in/ingenioussql.
Indexes and Views Unit 7.
SQL/Lesson 7/Slide 1 of 32 Implementing Indexes Objectives In this lesson, you will learn to: * Create a clustered index * Create a nonclustered index.
Session 1 Module 1: Introduction to Data Integrity
INTRODUCING SQL SERVER 2012 COLUMNSTORE INDEXES Exploring and Managing SQL Server 2012 Database Engine Improvements.
Sofia Event Center November 2013 Margarita Naumova SQL Master Academy.
Last Updated : 27 th April 2004 Center of Excellence Data Warehousing Group Teradata Performance Optimization.
5 Trends in the Data Warehousing Space Source: TDWI Report – Next Generation DW.
October 15-18, 2013 Charlotte, NC Accelerating Database Performance Using Compression Joseph D’Antoni, Solutions Architect Anexinet.
Boosting DWH-Performance with SQL Server 2016 ColumnStore Index.
--A Gem of SQL Server 2012, particularly for Data Warehousing-- Present By Steven Wang.
Understanding the Data Page Structure Sathya Nekkanti Senior Manager/Database Architect.
# CCNZ What is going on here???
SQLUG.be Case study: Redesign CDR archiving on SQL Server 2012 By Ludo Bernaerts April 16,2012.
Execution Plans Detail From Zero to Hero İsmail Adar.
Views / Session 3/ 1 of 40 Session 3 Module 5: Implementing Views Module 6: Managing Views.
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.
A Lap Around Columstore Martin Catherall SQL Saturday #464, Melbourne 20 th February 2016.
Data Integrity & Indexes / Session 1/ 1 of 37 Session 1 Module 1: Introduction to Data Integrity Module 2: Introduction to Indexes.
SQL IMPLEMENTATION & ADMINISTRATION Indexing & Views.
Introduction to columnstore indexes Taras Bobrovytskyi SQL wincor nixdorf.
Clustered Columnstore index deep dive
Chris Index Feng Shui Chris
In-Memory Capabilities
Katowice,
SQL 2014 Column Store Indexes
Dynamic SQL: Writing Efficient Queries on the Fly
T-SQL: Simple Changes That Go a Long Way
CSE-291 (Cloud Computing) Fall 2016
Example of a page header
The Five Ws of Columnstore Indexes
Database Administration for the Non-DBA
Migrating a Disk-based Table to a Memory-optimized one in SQL Server
PREMIER SPONSOR GOLD SPONSORS SILVER SPONSORS BRONZE SPONSORS SUPPORTERS.
Traveling in time with SQL Server 2017
Table Indexing for the .NET Developer
ColumnStore Index Primer
Azure SQL Data Warehouse Performance Tuning
Introduction to columnstore indexes
Introduction to partitioning
Creating HIGH PERFORMANCE TABULAR MODELS
20 Questions with Azure SQL Data Warehouse
11/29/2018 © 2014 Microsoft Corporation. All rights reserved. Microsoft, Windows, and other product names are or may be registered trademarks and/or trademarks.
Dynamic SQL: Writing Efficient Queries on the Fly
Azure SQL DWH: Optimization
Microsoft SQL Server 2014 for Oracle DBAs Module 7
The Five Ws of Columnstore Indexes
Realtime Analytics OLAP & OLTP in the mix
Weird Stuff I Saw While … Working With Heaps
Sunil Agarwal | Principal Program Manager
Stretch Database - Historical data storage in SQL Server 2016
Unleashing Stretched Databases
Four Rules For Columnstore Query Performance
Bulk Load and Minimal Logging
Using Columnstore indexes in Azure DevOps Services. Lessons learned
Using Columnstore indexes in Azure DevOps Services. Lessons learned
SQL Server Columnar Storage
Using Columnstore indexes in Azure DevOps Services. Lessons learned.
Sunil Agarwal | Principal Program Manager
Presentation transcript:

Clustered Columnstore Indexes (SQL Server 2014) Dave Fackler Business Intelligence Architect davef@rollinghillsky.com

Agenda What are (clustered) columnstore indexes? Some limitations How do inserts/updates/deletes work? Using clustered columnstore indexes

Columnstore Indexes Use new storage and compression based on columns (the Vertipaq engine) Data split into row groups of 102,400 to 1,048,576 rows Column segment created for each column in the table Column segments (each column) compressed and stored

Types of Columnstore Indexes Non-clustered columnstore indexes Introduced with SQL Server 2012 Can be built on table with clustered index or on a heap Only includes those columns that are included when built Makes the table read-only  Clustered columnstore indexes Introduced with SQL Server 2014 Is the only index on a table when created (no other indexes can be created) Includes all columns of the table Is updateable 

Limitations of Clustered Columnstore Indexes Cannot have any other indexes Table cannot have PK constraints, FK constraints, unique constraints Computed columns or sparse columns Unsupported data types (text, uniqueidentifier, geography, xml, timestamp, hierarchyid, varchar(max), nvarchar(max)) Cannot be combined with replication, change tracking, change data capture Cursors are not supported on CCI-indexed tables

Demo (Scripts 1-12)

How do Inserts/Updates/Deletes Work? Clustered columnstore indexes use delta stores Delta store is an “open” row group that can accept new rows If delta store exists (less than 102,400 rows), it can be used Otherwise, new delta stores are created as needed Inserts (unless using bulk insert) get added to delta store, but not immediately compressed Deletes get marked as deleted in columnstore segments Updates behave like deletes + inserts Delta stores get marked as “closed” once they are full

How do Inserts/Updates/Deletes Work? Closed delta stores compressed automatically over time Tuple Mover background process looks for closed delta stores Wakes up every few minutes, does work if needed, then sleeps Is single-threaded, so it can take a long time to handle lots of closed delta stores… ALTER INDEX … REORGANIZE Works like Tuple Mover, but is multi-threaded ALTER INDEX … REBUILD Closes open delta stores (even if small) Compresses all closed delta stores

Demo (Scripts 13-18)

Using Clustered Columnstore Indexes Initially loading a large amount of data (100M+ rows) Create table with regular clustered index, load, then create CCI Or create table with CCI and bulk load data Monitor rowgroups and minimize open/closed delta stores Queries must scan delta stores that are not compressed Data there is not sorted, not indexed, and acts like a (slow) heap Large number of rows in open/closed delta stores kills performance Use partitioning and reorganize/rebuild index by partition After large sets of changes, determine partitions affected Use REORGANIZE (faster) or REBUILD (more complete)

Using Clustered Columnstore Indexes Metadata information sys.column_store_segments Returns information about each column in each columnstore segment sys.column_store_dictionaries Returns information about dictionaries used (for columns needing them) sys.column_store_row_groups Returns information about rowgroups (likely the most useful of the three) sp_spaceused Warning: can return incorrect information for a table with CCI

Questions?

Special Thanks to Our Sponsors!