ColumnStore Indexes
ColumnStore Indexes
About me
The Basics
Key Characteristics
DEMO
SQL Server 2014 ColumnStore indexes
DEMO
Best Practices
Data Types
Restrictions
SQL Server 2016+ ColumnStore indexes
eMail : [email protected]
Twitter : @GarethSwan
Website : www.MyGareth.com
data
310 20010701 2171.29
data 310 data 20010701 data 2171.29
page 311 20010701 1912.15 page 311 page 20010701 page 1912.15
1000 312 20010702 2171.29 2000 312 2010 20010702 2040 2171.29
C1 C2 C3 C4 C5 C6
Row Group:
store
…
C1 C2 C3 C4 C5 C6
Updates
Column
Store
• After single row inserted (deltastore has been created and single row represented)
• After REBUILD
• REORGANIZE only moved delta store records into segment
• REBUILD affects entire index (or entire partition index) Segment row count increased by 1
• When inserting 102,400 rows or more in a single batch into a columnstore index distribution, the data will compress automatically
• When inserting 102,399 or less rows in a single batch, the data will be stored in the delta store
• The actual maximum number of rows per delta store is 1,048,576 at which point it is CLOSED
• This is also the ideal segment size that SQL Server will try to create when first building a columnstore index from a table
• When Index Build encounters memory pressure, DOP is reduced first and then segment size is reduced
• Only the REBUILD statement can compress a delta store that is not in the CLOSED state
• Neither REORGANIZE or the Tuple Mover process will have any effect on an OPEN delta store
• INSERT the partition key values 50 and 150 into the table
• INSERT three more records into partition 1 (Note partition 2 is still in deltastore form also)
• REBUILD the entire index (as opposed to the single partition above)
Note: When attempting a partition MERGE or SPLIT operation, be aware that a table with a columnstore index will return an error and fail to
execute whereas a traditional row-based clustered index/heap will perform the operation successfully