Introduction to columnstore indexes

Slides:



Advertisements
Similar presentations
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)
Advertisements

Project Management Database and SQL Server Katmai New Features Qingsong Yao
Module 4: Creating Data Types and Tables. Overview Creating Data Types Creating Tables Generating Column Values Generating Scripts.
DATABASES AND SQL. Introduction Relation: Relation means table(data is arranged in rows and columns) Domain : A domain is a pool of values appearing in.
Chapter 9 SQL and RDBMS Part C. SQL Copyright 2005 Radian Publishing Co.
 SQL stands for Structured Query Language.  SQL lets you access and manipulate databases.  SQL is an ANSI (American National Standards Institute) standard.
Oracle9i Database Administrator: Implementation and Administration 1 Chapter 9 Index Management.
Chapter 7 SQL HUANG XUEHUA. SQL SQL server2005 introduction Install components  management studio.
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.
SQL SQL Server : Overview SQL : Overview Types of SQL Database : Creation Tables : Creation & Manipulation Data : Creation & Manipulation Data : Retrieving.
Table Indexing for the.NET Developer Denny Cherry twitter.com/mrdenny.
Unit 6 Data Storage Design. Key Concepts 1. Database overview 2. SQL review 3. Designing fields 4. Denormalization 5. File organization 6. Object-relational.
1 Structured Query Language (SQL). 2 Contents SQL – I SQL – II SQL – III SQL – IV.
Denny Cherry twitter.com/mrdenny.
Module 3: Creating Data Types and Tables. Overview Working with Data Types Working with Tables Generating Column Values Generating Scripts.
CN2180 MS SQL Server Kemtis Kunanuraksapong MSIS with Distinction, A+ MCTS, MCDST, MCP.
Topic 1: Introduction to SQL. SQL stands for Structured Query Language. SQL is a standard computer language for accessing and manipulating databases SQL.
Database Systems Design, Implementation, and Management Coronel | Morris 11e ©2015 Cengage Learning. All Rights Reserved. May not be scanned, copied or.
SQL Fundamentals  SQL: Structured Query Language is a simple and powerful language used to create, access, and manipulate data and structure in the database.
Indexes / Session 2/ 1 of 36 Session 2 Module 3: Types of Indexes Module 4: Maintaining Indexes.
Introduction to Database System Adisak Intana Lecturer Chapter 7 : Data Integrity.
Indexes and Views Unit 7.
SQLintersection Putting the "Squeeze" on Large Tables Improve Performance and Save Space with Data Compression Justin Randall Tuesday,
INTRODUCING SQL SERVER 2012 COLUMNSTORE INDEXES Exploring and Managing SQL Server 2012 Database Engine Improvements.
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.
SQLUG.be Case study: Redesign CDR archiving on SQL Server 2012 By Ludo Bernaerts April 16,2012.
Turbocharge your DW Queries with ColumnStore Indexes Susan Price Senior Program Manager DW and Big Data.
Advanced SQL - DDL Advanced Database Dr. AlaaEddin Almabhouh.
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.
Database Constraints Ashima Wadhwa. Database Constraints Database constraints are restrictions on the contents of the database or on database operations.
Introducing Hekaton The next step in SQL Server OLTP performance Mladen Prajdić
Introduction to columnstore indexes Taras Bobrovytskyi SQL wincor nixdorf.
Clustered Columnstore index deep dive
Columnstore Indexing: From SQL Server 2012 to SQL Server 2014
In-Memory Capabilities
Temporal Databases Microsoft SQL Server 2016
Managing Tables, Data Integrity, Constraints by Adrienne Watt
Insert, Update and the rest…
Module 2: Creating Data Types and Tables
SQL 2014 Column Store Indexes
Temporal Databases Microsoft SQL Server 2016
Columnstore Index - is it the DW "Faster" switch you are looking for?
SQL Server 2016 JSON Support FOR Data Warehousing
SQL Implementation & Administration
The Five Ws of Columnstore Indexes
Migrating a Disk-based Table to a Memory-optimized one in SQL Server
PREMIER SPONSOR GOLD SPONSORS SILVER SPONSORS BRONZE SPONSORS SUPPORTERS.
ColumnStore Index Primer
Introduction to partitioning
TechEd /20/ :49 PM © 2013 Microsoft Corporation. All rights reserved. Microsoft, Windows, and other product names are or may be registered.
11/29/2018 © 2014 Microsoft Corporation. All rights reserved. Microsoft, Windows, and other product names are or may be registered trademarks and/or trademarks.
Database systems Lecture 2 – Data Types
TechEd /2/2018 7:32 AM © 2013 Microsoft Corporation. All rights reserved. Microsoft, Windows, and other product names are or may be registered trademarks.
Microsoft SQL Server 2014 for Oracle DBAs Module 7
The Five Ws of Columnstore Indexes
Realtime Analytics OLAP & OLTP in the mix
Sunil Agarwal | Principal Program Manager
Session - 6 Sequence - 1 SQL: The Structured Query Language:
Why Should I Care About … Partitioned Views?
Clustered Columnstore Indexes (SQL Server 2014)
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:

Introduction to columnstore indexes Taras Bobrovytskyi

Sponsors

About me Senior Database Developer/Data architect @ Wincor Nixdorf MCITP 2008 DB Administrator DB Developer MCT (2007-2013)

Introduction to columnstore indexes General overview Creating columnstore indexes Storage Usage scenarios

General overview Part of MS in-memory processing strategy xVelocity in SSAS tabular mode Vertipaq compression Large data

Creating columnstore index Syntax Restrictions Memory usage

Syntax CREATE NONCLUSTERED COLUMNSTORE INDEX [csindx_FactResellerSales] ON [FactResellerSales] ( [OrderQuantity], [UnitPrice], [ExtendedAmount], [UnitPriceDiscountPct], [DiscountAmount], [ProductStandardCost], [TotalProductCost], [SalesAmount], [TaxAmt], [Freight], [CarrierTrackingNumber], [CustomerPONumber], [OrderDate], [DueDate], [ShipDate] );

Restrictions – data types binary and varbinary ntext , text, and image varchar(max) and nvarchar(max) uniqueidentifier rowversion (and timestamp) sql_variant decimal (and numeric) with precision greater than 18 digits datetimeoffset with scale greater than 2 CLR types (hierarchyid and spatial types) xml

Restrictions Cannot have more than 1024 columns. Cannot be clustered. Only nonclustered columnstore indexes are available. (2012 version only) Cannot be a unique index. Cannot be created on a view or indexed view. Cannot include a sparse column. Cannot act as a primary key or a foreign key. Cannot be changed using the ALTER INDEX statement (since 2014 – REBUILD,REORGANIZE). Cannot be created with the INCLUDE keyword. Cannot include the ASC or DESC  Cannot contain a column with a FILESTREAM attribute.

Memory usage MG= ((4.2*CN)+68)*PN+CCN*34 MG – memory grant (in MB) CN – number of columns in columnstore index PN – number of processors CCN – number of character columns

Memory usage Alter default workload group to increase the request memory grant ALTER WORKLOAD GROUP [DEFAULT] WITH (REQUEST_MAX_MEMORY_GRANT_PERCENT=75) ALTER RESOURCE GOVERNOR RECONFIGURE

Storage Rowgroups ( 2 20 =1,048,576 rows per row group) Column Segments Vertipaq compression

Nonclustered columnstore

Clustered columnstore

Usage scenarios Selecting data Updating data Rebuild index

Selecting data from columnstore SELECT SalesTerritoryKey, SUM(ExtendedAmount) AS SalesByTerritory FROM FactResellerSalesPtnd GROUP BY SalesTerritoryKey; columnstore index scan bitmap operator

Updating data Nonclustered indexes

Updating data Nonclustered Index ALTER INDEX mycolumnstoreindex ON mytable DISABLE; -- update mytable – ALTER INDEX mycolumnstoreindex on mytable REBUILD

Updating data Partitioned table scenario Staging table for data updating ALTER TABLE FactInternetSales_Partitioned SWITCH PARTITION 1 TO FactInternetSales_Stage

Updating data Clustered indexes CREATE TABLE T1( ProductKey [int] NOT NULL, OrderDateKey [int] NOT NULL, DueDateKey [int] NOT NULL, ShipDateKey [int] NOT NULL); GO CREATE CLUSTERED COLUMNSTORE INDEX cci_T1 ON T1; GO

Updating data Clustered indexes Normal DML/Bulk operations

Updating data Clustered indexes

Updating data Deltastore usage Rowgroup bottom threshold – 102,400 rows Bulk operation Split by 2 20 =1,048,576 rows

Updating data DML operations on clustered columnstore INSERT DELETE adds row to deltastore Tuple mover moves filled deltastore rowgroup to columnstore DELETE Marks row as deleted in columnstore Removed on index rebuild UPDATE

Rebuilding index Nonclustered indexes Clustered indexes Delete bitmaps applied Defragmentation of columnstore Merge with deltastore

Columnstore in 2016 Table as columnstore Ability to mix columnstore and rowstore indexes on a table Updateable nonclustered columnstore indexes in-Memory features one columnstore allowed in-Memory limitation defined at creation must include all columns must include all rows

Updateable nonclustered columnstore Act as clustered Concept of operational analytics

Concepts of operational analytics Example 1

Concepts of operational analytics Example 2

In-memory columnstore

Data warehousing Snapshot and read-commited snapshot isolation levels Rowstore primary key indexes on columnstore tables Increase performance of table seeks Row locking + Row group level locking DBCC traceon (10204, -1); Snapshot and read-commited snapshot isolation levels

Introduction to Vertipaq Dictionary-based encoding Value-based encoding

Vertipaq Dictionary based encoding Primary dictionary (shared) Secondary dictionary (for each segment) – only for string columns segment AAA BBB CCC dictionary segment 1 2 3 AAA BBB CCC

Vertipaq Value-based encoding Exact numerics (integer, decimal) Many distinct values 1-7 segment segment 1 4 2 5 3 7 6

Vertipaq Value-based encoding Decimals minimal exponent of 3 substract the minimal of 800 0.8 11.22 3.141 800 11220 3141 10420 2341 minimal exponent of -2 substract the minimal of 9 900 1100 2345000 9 11 23450 2 23441

Questions?

Thanks