Search icon CANCEL
Subscription
0
Cart icon
Cart
Close icon
You have no products in your basket yet
Save more on your purchases!
Savings automatically calculated. No voucher code required
Arrow left icon
All Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Newsletters
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
SQL Server 2016 Developer's Guide

You're reading from  SQL Server 2016 Developer's Guide

Product type Book
Published in Mar 2017
Publisher Packt
ISBN-13 9781786465344
Pages 616 pages
Edition 1st Edition
Languages
Authors (3):
Miloš Radivojević Miloš Radivojević
Profile icon Miloš Radivojević
Dejan Sarka Dejan Sarka
Profile icon Dejan Sarka
William Durkin William Durkin
Profile icon William Durkin
View More author details
Toc

Table of Contents (21) Chapters close

SQL Server 2016 Developer's Guide
Credits
About the Authors
About the Reviewer
www.PacktPub.com
Customer Feedback
Preface
1. Introduction to SQL Server 2016 2. Review of SQL Server Features for Developers 3. SQL Server Tools 4. Transact-SQL Enhancements 5. JSON Support in SQL Server 6. Stretch Database 7. Temporal Tables 8. Tightening the Security 9. Query Store 10. Columnstore Indexes 11. Introducing SQL Server In-Memory OLTP 12. In-Memory OLTP Improvements in SQL Server 2016 13. Supporting R in SQL Server 14. Data Exploration and Predictive Modeling with R in SQL Server

Clustered columnstore indexes


In the last section of this chapter, you will learn how to manage a clustered columnstore index (CCI). Besides optimizing query performance, you will also learn how to add a regular B-tree nonclustered index (NCI) to a CCI and use it instead of the primary key or unique constraints. When creating the NCCI in the previous section, the LZ77 or the archive compression has not been used yet. You will use it with a CCI in this section. Altogether, you will learn how to do the following:

  • Create clustered columnstore indexes

  • Use archive compression

  • Add B-tree NCI to a CCI

  • Use B-tree NCI for a constraint

  • Update data in a CCI

Compression and query performance

Let's start by dropping both indexes from the demo fact table, the NCCI and the CI, to make a heap again:

USE WideWorldImportersDW; 
-- Drop the NCCI 
DROP INDEX NCCI_FactTest 
  ON dbo.FactTest; 
-- Drop the CI 
DROP INDEX CL_FactTest_DateKey 
  ON dbo.FactTest; 
GO 

Now let's create...

lock icon The rest of the chapter is locked
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at ₹800/month. Cancel anytime