Skip to Main Content
SQL Server 2017 Developer???s Guide
book

SQL Server 2017 Developer???s Guide

by Dejan Sarka, Miloš Radivojević, William Durkin
March 2018
Intermediate to advanced content levelIntermediate to advanced
816 pages
19h 35m
English
Packt Publishing
Content preview from SQL Server 2017 Developer???s Guide

Testing the nonclustered columnstore index

The following code creates an NCCI on the fact table, this time without a filter, so all data is included in the NCCI:

CREATE NONCLUSTERED COLUMNSTORE INDEX NCCI_FactTest 
ON dbo.FactTest 
(SaleKey, CustomerKey,  
 Customer, CityKey, City, 
 DateKey, StockItemKey, 
 Product, Quantity, 
 TotalAmount, Profit); 
GO 

So how much space is used by the test fact table now? Let's check it again with the following code:

EXEC sys.sp_spaceused N'dbo.FactTest', @updateusage = N'TRUE'; 
GO 

The result is as follows:

Name          rows     reserved   data       index_size  unused 
------------  -------  ---------  ---------  ----------  -------
dbo.FactTest  2279810  529680 KB  498528 KB  29432 KB    1720 KB

Note the numbers. The index size is about 17 times ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

SQL Server 2016 Developer's Guide

SQL Server 2016 Developer's Guide

Miloš Radivojević, Dejan Sarka, William Durkin
Mastering SQL Server 2017

Mastering SQL Server 2017

Milos Radivojevic, Dejan Sarka, William Durkin, Christian Cote, Matija Lah

Publisher Resources

ISBN: 9781788476195Supplemental Content