Your SlideShare is downloading. ×



Published on

Who is afraid of Columnstore Indexes? (Michael Zilberstein, DB-Art) …

Who is afraid of Columnstore Indexes? (Michael Zilberstein, DB-Art)

This talk describes new SQL Server 2012 feature called "columnstore index". In this session we will learn about the differences between columnstore indexes and B-Tree indexes we are used to work with. We will see when it is best to use and when not to use this new index. We will cover limitations that columnstore index imposes on the tables that use it and how to live with those limitations. Like in all my sessions, I won't let you go without some internals – how columnstore index is organized on a physical level and how Query Processor works this new type of index. And of course Demos, Demos, Demos…

Published in: Technology
  • Be the first to comment

  • Be the first to like this

No Downloads
Total Views
On Slideshare
From Embeds
Number of Embeds
Embeds 0
No embeds

Report content
Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

No notes for slide


  • 1. Who is afraid of Columnstore Index? Michael Zilberstein
  • 2. DEMO 2
  • 3. History Column-oriented databases: –Sybase IQ –Vertica ColumnOrders –Aster Data Doric –Greenplum Ionic –… Excel PowerPivot. Corinthian VertiPaq. xVelocity Columnstore index. 3
  • 4. Storage internals C1 C2 C3 C4 C5 C6Uses VertiPaqcompression 4
  • 5. Reduced IO Fetches only needed columns from diskSELECT C2, SUM (C3) … C2 C3 Columns are compressed C1 C4 C5 C6 Less IO Better buffer hit rates 5
  • 6. New query execution technology Batch mode execution of some operations – processes rows in batches – groups of batch operations in query plan Better parallelism, better algorithms 6
  • 7. Dictionary-based compression Year of Code Birth 1996 1Fact - 60 distinct values 1975 15 Internal Dictionary 1948 50 Year of 1932 58 Birth … 60 1996 On-the-fly build dictionary with all distinct value. 1975 Substitute non-selective 1975 values with ID. Index in our example – 6 bits 1948 Year of per row. Birth 1932 Code 1 Compressed Fact … 15 15 50 58 60 7
  • 8. SegmentsC1 C2 C3 C4 C5 C6 Column segment Set of contains values from about 1M one column for a set rows of about 1M rows Column segments are compressed Each column segment stored in separate LOB Column segment is Column unit of transfer from Segment disk 8
  • 9. Data Dictionary Views 9
  • 10. New execution plan elements 10
  • 11. Best practices / worst practices Best practices: –Put columnstore indexes on large tables only. –Include every column of the table in the columnstore index. –Structure your queries as star joins with grouping and aggregation as much as possible. Worst practices: –Avoid JOIN and/or filter on string columns in the table with columnstore index. –Avoid OUTER JOIN, UNION ALL, IN/NOT IN. –Avoid JOIN between 2 Fact tables. 11
  • 12. Datatype Limitations Decimal > 18 digits (Var)Binary BLOB (N)Varchar(max) Uniqueidentifier Date/Time types > 8 bytes (Datetime2 etc) CLR 12
  • 13. Issues and Workarounds: good, bad and ugly Outer Joins NOT IN Scalar Aggregates Multiple DISTINCT UNION ALL IN and EXISTS 13
  • 14. Data loading and columnstore index Columnstore index makes table read-only. DEMO 14
  • 15. Data loading and columnstore index 2 ways to load data: – Partition switching – Disable/drop index -> load data -> create/rebuild index. 15
  • 16. References 11/DBI312 95.sql-server-columnstore-performance-tuning.aspx 16
  • 17. Q&A 17
  • 18. IsraelMob: +972-52-4767219Tel/Fax: +972-3-9504130E-Mail: 35 Vinik St. Rishon Lezion 75241The Art of Database Administration