My last post about nonclustered Columnstore indexes was written back on February 25th, 2012 (Exploring Columnstore Index Metadata, Segment Distribution and Elimination Behaviors<\/a>).\u00a0 Amazed by how quickly time passes.<\/p>\n Anyhow, this is a quick post on segment population skew based on parallel nonclustered Columnstore index creations.<\/p>\n I\u2019ll use the same 123,695,104 row FactInternetSales table I used almost a year ago to demonstrate.\u00a0 I\u2019ll create the following nonclustered Columnstore index just on one column, to keep things simple:<\/p>\n The index takes 31 seconds to create on my laptop and it was created using 8 threads (which I can confirm via the SQL Server execution plan in, this case, SQL Sentry Plan Explorer):<\/p>\n Adding up the actual rows by thread, we get the 123,695,104 row count.<\/p>\n Now if we look at sys.column_store_segments, we can see that the last few segments were populated with less than the maximum 1,048,576 rows:<\/p>\n\r\nCREATE NONCLUSTERED COLUMNSTORE INDEX [NCSI_FactInternetSales]\r\nON [dbo].[FactInternetSales]\r\n(\r\n[ProductKey]\r\n);\r\n <\/pre>\n
<\/a><\/p>\n\r\nSELECT\u00a0 [partition_id],\r\n[column_id],\r\n[segment_id],\r\n[row_count]\r\nFROM sys.column_store_segments\r\nWHERE [row_count] = 1048576 AND\r\n[column_id] = 2;\r\n<\/pre>\n