Your SlideShare is downloading. ×
0
Who is afraid of Columnstore Index?          Michael Zilberstein          Michael@DBArt.co.il
DEMO       2
History Column-oriented databases:  –Sybase IQ  –Vertica                      ColumnOrders  –Aster Data                   ...
Storage internals                C1   C2   C3   C4   C5   C6Uses VertiPaqcompression                                      ...
Reduced IO                               Fetches only needed columns                               from diskSELECT C2, SUM...
New query execution technology Batch mode execution of some operations  – processes rows in batches  – groups of batch ope...
Dictionary-based compression                            Year of     Code                            Birth                 ...
SegmentsC1   C2   C3   C4   C5   C6               Column segment                               Set of     contains values ...
Data Dictionary Views                        9
New execution plan elements                              10
Best practices / worst practices Best practices:  –Put columnstore indexes on large tables only.  –Include every column of...
Datatype Limitations Decimal > 18 digits (Var)Binary BLOB (N)Varchar(max) Uniqueidentifier Date/Time types > 8 bytes (Date...
Issues and Workarounds: good, bad and ugly Outer Joins NOT IN Scalar Aggregates Multiple DISTINCT UNION ALL IN and EXISTS ...
Data loading and columnstore index Columnstore index makes table read-only.    DEMO                                       ...
Data loading and columnstore index 2 ways to load data:   – Partition switching   – Disable/drop index -> load data ->    ...
References http://channel9.msdn.com/Events/TechEd/NorthAmerica/20 11/DBI312 http://social.technet.microsoft.com/wiki/conte...
Q&A      17
IsraelMob: +972-52-4767219Tel/Fax: +972-3-9504130E-Mail: contact@dbart.co.ilOffice: 35 Vinik St. Rishon Lezion 75241The Ar...
Upcoming SlideShare
Loading in...5
×

מיכאל

552

Published on

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
0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total Views
552
On Slideshare
0
From Embeds
0
Number of Embeds
1
Actions
Shares
0
Downloads
3
Comments
0
Likes
0
Embeds 0
No embeds

No notes for slide

Transcript of "מיכאל"

  1. 1. Who is afraid of Columnstore Index? Michael Zilberstein Michael@DBArt.co.il
  2. 2. DEMO 2
  3. 3. History Column-oriented databases: –Sybase IQ –Vertica ColumnOrders –Aster Data Doric –Greenplum Ionic –… Excel PowerPivot. Corinthian VertiPaq. xVelocity Columnstore index. 3
  4. 4. Storage internals C1 C2 C3 C4 C5 C6Uses VertiPaqcompression 4
  5. 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. 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. 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. 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. 9. Data Dictionary Views 9
  10. 10. New execution plan elements 10
  11. 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. 12. Datatype Limitations Decimal > 18 digits (Var)Binary BLOB (N)Varchar(max) Uniqueidentifier Date/Time types > 8 bytes (Datetime2 etc) CLR 12
  13. 13. Issues and Workarounds: good, bad and ugly Outer Joins NOT IN Scalar Aggregates Multiple DISTINCT UNION ALL IN and EXISTS 13
  14. 14. Data loading and columnstore index Columnstore index makes table read-only. DEMO 14
  15. 15. Data loading and columnstore index 2 ways to load data: – Partition switching – Disable/drop index -> load data -> create/rebuild index. 15
  16. 16. References http://channel9.msdn.com/Events/TechEd/NorthAmerica/20 11/DBI312 http://social.technet.microsoft.com/wiki/contents/articles/49 95.sql-server-columnstore-performance-tuning.aspx 16
  17. 17. Q&A 17
  18. 18. IsraelMob: +972-52-4767219Tel/Fax: +972-3-9504130E-Mail: contact@dbart.co.ilOffice: 35 Vinik St. Rishon Lezion 75241The Art of Database Administration
  1. A particular slide catching your eye?

    Clipping is a handy way to collect important slides you want to go back to later.

×