SlideShare une entreprise Scribd logo
1  sur  18
Who is afraid of Columnstore Index?


          Michael Zilberstein
          Michael@DBArt.co.il
DEMO
       2
History

 Column-oriented databases:
  –Sybase IQ
  –Vertica                      ColumnOrders

  –Aster Data                   Doric
  –Greenplum
                                Ionic
  –…
 Excel PowerPivot.              Corinthian

 VertiPaq.
 xVelocity Columnstore index.

                                               3
Storage internals




                C1   C2   C3   C4   C5   C6




Uses VertiPaq
compression




                                              4
Reduced IO

                               Fetches only needed columns
                               from disk
SELECT C2, SUM (C3) …
      C2   C3                  Columns are compressed
 C1             C4   C5   C6
                               Less IO
                               Better buffer hit rates




                                                             5
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
Dictionary-based compression
                            Year of     Code
                            Birth


                            1996        1
Fact - 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
Segments


C1   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
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 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
Datatype Limitations

 Decimal > 18 digits
 (Var)Binary
 BLOB
 (N)Varchar(max)
 Uniqueidentifier
 Date/Time types > 8 bytes (Datetime2 etc)
 CLR




                                             12
Issues and Workarounds: good, bad and ugly


 Outer Joins
 NOT IN
 Scalar Aggregates
 Multiple DISTINCT
 UNION ALL
 IN and EXISTS




                                             13
Data loading and columnstore index

 Columnstore index makes table read-only.




    DEMO
                                            14
Data loading and columnstore index

 2 ways to load data:
   – Partition switching
   – Disable/drop index -> load data ->
    create/rebuild index.




                                          15
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
Q&A

      17
Israel
Mob: +972-52-4767219
Tel/Fax: +972-3-9504130
E-Mail: contact@dbart.co.il
Office: 35 Vinik St. Rishon Lezion 75241
The Art of Database Administration

Contenu connexe

Similaire à מיכאל

Chapter 1SyllabusCatalog Description Computer structu
Chapter 1SyllabusCatalog Description Computer structuChapter 1SyllabusCatalog Description Computer structu
Chapter 1SyllabusCatalog Description Computer structu
EstelaJeffery653
 

Similaire à מיכאל (20)

VAST-Tree, EDBT'12
VAST-Tree, EDBT'12VAST-Tree, EDBT'12
VAST-Tree, EDBT'12
 
SqlSaturday199 - Columnstore Indexes
SqlSaturday199 - Columnstore IndexesSqlSaturday199 - Columnstore Indexes
SqlSaturday199 - Columnstore Indexes
 
Cs 64
Cs 64Cs 64
Cs 64
 
Fosdem 2012 practical_indexing
Fosdem 2012 practical_indexingFosdem 2012 practical_indexing
Fosdem 2012 practical_indexing
 
Project Report Multilevel Cache
Project Report Multilevel CacheProject Report Multilevel Cache
Project Report Multilevel Cache
 
Microcontroller part 4
Microcontroller part 4Microcontroller part 4
Microcontroller part 4
 
Realtime Per Face Texture Mapping (PTEX)
Realtime Per Face Texture Mapping (PTEX)Realtime Per Face Texture Mapping (PTEX)
Realtime Per Face Texture Mapping (PTEX)
 
Lec05
Lec05Lec05
Lec05
 
Databases for Storage Engineers
Databases for Storage EngineersDatabases for Storage Engineers
Databases for Storage Engineers
 
Interview qa
Interview qaInterview qa
Interview qa
 
"MySQL Boosting - DB Best Practices & Optimization" by José Luis Martínez - C...
"MySQL Boosting - DB Best Practices & Optimization" by José Luis Martínez - C..."MySQL Boosting - DB Best Practices & Optimization" by José Luis Martínez - C...
"MySQL Boosting - DB Best Practices & Optimization" by José Luis Martínez - C...
 
Boosting MySQL (for starters)
Boosting MySQL (for starters)Boosting MySQL (for starters)
Boosting MySQL (for starters)
 
Dot matrix display design using fpga
Dot matrix display design using fpgaDot matrix display design using fpga
Dot matrix display design using fpga
 
Compressing column-oriented indexes
Compressing column-oriented indexesCompressing column-oriented indexes
Compressing column-oriented indexes
 
Cassandra 2012 scandit
Cassandra 2012 scanditCassandra 2012 scandit
Cassandra 2012 scandit
 
Computer Systems Organization
Computer Systems OrganizationComputer Systems Organization
Computer Systems Organization
 
Optimizing the Graphics Pipeline with Compute, GDC 2016
Optimizing the Graphics Pipeline with Compute, GDC 2016Optimizing the Graphics Pipeline with Compute, GDC 2016
Optimizing the Graphics Pipeline with Compute, GDC 2016
 
Dsd previous year university questions
Dsd previous year university questionsDsd previous year university questions
Dsd previous year university questions
 
Chapter 1SyllabusCatalog Description Computer structu
Chapter 1SyllabusCatalog Description Computer structuChapter 1SyllabusCatalog Description Computer structu
Chapter 1SyllabusCatalog Description Computer structu
 
Clustered Columnstore - Deep Dive
Clustered Columnstore - Deep DiveClustered Columnstore - Deep Dive
Clustered Columnstore - Deep Dive
 

Plus de sqlserver.co.il

Windows azure sql_database_security_isug012013
Windows azure sql_database_security_isug012013Windows azure sql_database_security_isug012013
Windows azure sql_database_security_isug012013
sqlserver.co.il
 
Things you can find in the plan cache
Things you can find in the plan cacheThings you can find in the plan cache
Things you can find in the plan cache
sqlserver.co.il
 
Sql server user group news january 2013
Sql server user group news   january 2013Sql server user group news   january 2013
Sql server user group news january 2013
sqlserver.co.il
 
SQL Explore 2012: P&T Part 3
SQL Explore 2012: P&T Part 3SQL Explore 2012: P&T Part 3
SQL Explore 2012: P&T Part 3
sqlserver.co.il
 
SQL Explore 2012: P&T Part 2
SQL Explore 2012: P&T Part 2SQL Explore 2012: P&T Part 2
SQL Explore 2012: P&T Part 2
sqlserver.co.il
 
SQL Explore 2012: P&T Part 1
SQL Explore 2012: P&T Part 1SQL Explore 2012: P&T Part 1
SQL Explore 2012: P&T Part 1
sqlserver.co.il
 
SQL Explore 2012 - Tzahi Hakikat and Keren Bartal: Extended Events
SQL Explore 2012 - Tzahi Hakikat and Keren Bartal: Extended EventsSQL Explore 2012 - Tzahi Hakikat and Keren Bartal: Extended Events
SQL Explore 2012 - Tzahi Hakikat and Keren Bartal: Extended Events
sqlserver.co.il
 
SQL Explore 2012 - Meir Dudai: DAC
SQL Explore 2012 - Meir Dudai: DACSQL Explore 2012 - Meir Dudai: DAC
SQL Explore 2012 - Meir Dudai: DAC
sqlserver.co.il
 
SQL Explore 2012 - Aviad Deri: Spatial
SQL Explore 2012 - Aviad Deri: SpatialSQL Explore 2012 - Aviad Deri: Spatial
SQL Explore 2012 - Aviad Deri: Spatial
sqlserver.co.il
 
Bi303 data warehousing with fast track and pdw - Assaf Fraenkel
Bi303 data warehousing with fast track and pdw - Assaf FraenkelBi303 data warehousing with fast track and pdw - Assaf Fraenkel
Bi303 data warehousing with fast track and pdw - Assaf Fraenkel
sqlserver.co.il
 
Fast transition to sql server 2012 from mssql 2005 2008 for developers - Dav...
Fast transition to sql server 2012 from mssql 2005 2008 for  developers - Dav...Fast transition to sql server 2012 from mssql 2005 2008 for  developers - Dav...
Fast transition to sql server 2012 from mssql 2005 2008 for developers - Dav...
sqlserver.co.il
 

Plus de sqlserver.co.il (20)

Windows azure sql_database_security_isug012013
Windows azure sql_database_security_isug012013Windows azure sql_database_security_isug012013
Windows azure sql_database_security_isug012013
 
Things you can find in the plan cache
Things you can find in the plan cacheThings you can find in the plan cache
Things you can find in the plan cache
 
Sql server user group news january 2013
Sql server user group news   january 2013Sql server user group news   january 2013
Sql server user group news january 2013
 
DAC 2012
DAC 2012DAC 2012
DAC 2012
 
Query handlingbytheserver
Query handlingbytheserverQuery handlingbytheserver
Query handlingbytheserver
 
Adi Sapir ISUG 123 11/10/2012
Adi Sapir ISUG 123 11/10/2012Adi Sapir ISUG 123 11/10/2012
Adi Sapir ISUG 123 11/10/2012
 
Products.intro.forum version
Products.intro.forum versionProducts.intro.forum version
Products.intro.forum version
 
SQL Explore 2012: P&T Part 3
SQL Explore 2012: P&T Part 3SQL Explore 2012: P&T Part 3
SQL Explore 2012: P&T Part 3
 
SQL Explore 2012: P&T Part 2
SQL Explore 2012: P&T Part 2SQL Explore 2012: P&T Part 2
SQL Explore 2012: P&T Part 2
 
SQL Explore 2012: P&T Part 1
SQL Explore 2012: P&T Part 1SQL Explore 2012: P&T Part 1
SQL Explore 2012: P&T Part 1
 
SQL Explore 2012 - Tzahi Hakikat and Keren Bartal: Extended Events
SQL Explore 2012 - Tzahi Hakikat and Keren Bartal: Extended EventsSQL Explore 2012 - Tzahi Hakikat and Keren Bartal: Extended Events
SQL Explore 2012 - Tzahi Hakikat and Keren Bartal: Extended Events
 
SQL Explore 2012 - Meir Dudai: DAC
SQL Explore 2012 - Meir Dudai: DACSQL Explore 2012 - Meir Dudai: DAC
SQL Explore 2012 - Meir Dudai: DAC
 
SQL Explore 2012 - Aviad Deri: Spatial
SQL Explore 2012 - Aviad Deri: SpatialSQL Explore 2012 - Aviad Deri: Spatial
SQL Explore 2012 - Aviad Deri: Spatial
 
מיכאל
מיכאלמיכאל
מיכאל
 
נועם
נועםנועם
נועם
 
עדי
עדיעדי
עדי
 
Bi303 data warehousing with fast track and pdw - Assaf Fraenkel
Bi303 data warehousing with fast track and pdw - Assaf FraenkelBi303 data warehousing with fast track and pdw - Assaf Fraenkel
Bi303 data warehousing with fast track and pdw - Assaf Fraenkel
 
DBCC - Dubi Lebel
DBCC - Dubi LebelDBCC - Dubi Lebel
DBCC - Dubi Lebel
 
Fast transition to sql server 2012 from mssql 2005 2008 for developers - Dav...
Fast transition to sql server 2012 from mssql 2005 2008 for  developers - Dav...Fast transition to sql server 2012 from mssql 2005 2008 for  developers - Dav...
Fast transition to sql server 2012 from mssql 2005 2008 for developers - Dav...
 
ISUG 113: File stream
ISUG 113: File streamISUG 113: File stream
ISUG 113: File stream
 

Dernier

Dernier (20)

Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 
GenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdfGenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdf
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century education
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
 
What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Script
 
Tech Trends Report 2024 Future Today Institute.pdf
Tech Trends Report 2024 Future Today Institute.pdfTech Trends Report 2024 Future Today Institute.pdf
Tech Trends Report 2024 Future Today Institute.pdf
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
 

מיכאל

  • 1. Who is afraid of Columnstore Index? Michael Zilberstein Michael@DBArt.co.il
  • 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 C6 Uses VertiPaq compression 4
  • 5. Reduced IO Fetches only needed columns from disk SELECT 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 1 Fact - 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. Segments C1 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
  • 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 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. Q&A 17
  • 18. Israel Mob: +972-52-4767219 Tel/Fax: +972-3-9504130 E-Mail: contact@dbart.co.il Office: 35 Vinik St. Rishon Lezion 75241 The Art of Database Administration