Columnstore has been available since SQL Server 2012. However, when it was introduced, it just wasn't quite ready for most people to use. Times have certainly changed. Now, it's time to use the columnstore index.
Predicting HDB Resale Prices - Conducting Linear Regression Analysis With Orange
Time to Use the Columnstore Index
1. Time to Use the
Columnstore Index
GRANT FRITCHEY, PRODUCT ADVOCATE, REDGATE SOFTWARE
2. Goals
Understand how the columnstore index works and how it’s
different than traditional, row store, indexes
Learn the limitations and gotchas around the columnstore index
Study places where columnstore benefits performance
4. Row Store
ID Name Description Date
1 Grant Doof 1/10/17
2 Jeff Not a doof 3/4/55
3 Gabby Smart 9/2/92
4 Jeff Not a doof 8/6/73
5 Achmed Smart 1/10/17
6 Jeff Not a doof 11/22/87
7 Suzanne Not a doof 1/10/17
8. Columnstore Index Use
Prior to 2016
(sp1), Enterprise
only
Clustered
columnstore
(2014+)
Nonclustered
columnstore
Columnstore on
memory-
optimized table
(2016+)
B-tree indexes on
clustered
columnstore
(2016+)
Filtered
nonclustered
columnstore
(2016+)
It all works with
Azure SQL
Database
9. Columnstore Limitations: Data Types
NTEXT, TEXT,
IMAGE
VARCHAR/NVAR
CHAR/VARBINAR
Y(MAX), below
2017
ROWVERION/TI
MESTAMP
SQL_VARIANT (a
feature, not a
bug)
CLR (including
spatial &
hierarchy)
XML GUID, 2012 only
12. Columnstore Limitations: 2014 or Less
Change Tracking Change Data
Capture
Readable
Secondary –
clustered
columnstore
only
Multple Active
Result Sets
(MARS)
Views or Indexed
Views
14. Loading Columnstore
102,400 rows –
Recommended batch
size
1,048,576 rows per
rowgroup
Don’t pre-sort data Trickle loads &
modifications
Deletes require
reorg/rebuild
Inserts added to delta
group
Updates are logical to
delta group
Parallel Data Loads
17. Why Is Columnstore Faster
First, last,
always, it
depends on
the type of
query
Data
Compression
Column
Elimination
Rowgroup
Elimination
Batch Mode
Execution
Aggregate
Pushdown
(2016+)
String
Predicate
Pushdown
(sketchy, but
interesting)
18. Batch Mode Execution
Columnstore Only 64 to 900
rows/batch
Use the Execution
Plan to understand
Parallel execution
required for 2012 &
2014
19. Recommended Columnstore Use
First, determine
data access path
Second,
understand the
data load
process
Third, know
your queries
Fourth,
generally,
greater than
100k rows
Better with 1
million +
Mix and Match
20. When To Use Columnstore Index
Fact Tables Large
Dimension
Tables
Data
Warehousing
in general
Analytical
Queries
Aggregate
Queries
Lots of Large
Scans
21. Resources
Niko Negebauer: http://www.nikoport.com/columnstore/
Simple Talk: https://www.red-gate.com/Search/?s=columnstore&t=simpletalk
SQL Server Central Stairway: https://www.sqlservercentral.com/stairways/stairway-to-
columnstore-indexes
My Resources:
◦ Code: https://github.com/ScaryDBA/PresentationCode
◦ Slide: https:/slideshare
22. Goals
Understand how the columnstore index works and how it’s
different than traditional, row store, indexes
Learn the limitations and gotchas around the columnstore index
Study places where columnstore benefits performance