Quantcast
Channel: SQLServerCentral » SQL Server 2014 » Development - SQL Server 2014 » Latest topics
Viewing all articles
Browse latest Browse all 3145

Best way to build a partitioned clustered columnstore

$
0
0
I am building three partitioned, clustered column store tables.I was researching whether it was faster to populate a staging table and swap it into the partitioned table or to directly insert into the partitioned table. I thought it would load faster that way if I could use minimal logging, etc.The first partition for the three tables will have:Table F: 50M rows, 6 columns wide, partitioned on a date column (1 date, 2 bigint keys, and two varchar columns)Table D1: 50M rows, 150 columns wide, partitioned on a bigintTable D2: 19M rows, 300 columns wide, partitioned on a bigintIf build the data that would go into partition 1 in a non partitioned column store, I get these table sizes:Table F: 476 MBTable D1: 6,800 MBTable D2: 5,496 MBIf build the same data directly in the partitioned column store, my table sizes end up being:Table F: 579 MBTable D1: 6,800 MBTable D2: 5,364 MBThat's a 20% difference on Table F, the narrow table.Looking at the row groups, I see 47 identical row groups in partition 1 and the unpartitioned table, but the average "size_in_bytes" is consistently 20% smaller in the unpartitioned table.Any idea why I'm getting better compression on the unpartitioned table?

Viewing all articles
Browse latest Browse all 3145

Trending Articles