Let’s start with a simple test of merging the 2007 partition with the year 2008, by issuing the following command:
12 ALTER PARTITION FUNCTION pfOnlineSalesDate ()MERGE RANGE (‘2008-01-01’);It might ready you a reasonably huge surprise, but this command will fail, if you are using the Columnstore Indexes.
123 Msg 35344, Level 15, State 1, Line 26MERGE clause of ALTER PARTITION statement failed because two nonempty partitions containing a columnstore index cannot be merged.Consider disabling the columnstore index before issuing the ALTER PARTITION statement, then rebuilding the columnstore index after ALTER PARTITION is complete.The very same command will function without any problem, if we would simply avoid creating Clustered Columnstore Index …
The reason behind this limitation has to do with the fact that Columnstore Indexes do not sort or control the boundaries of the data, and this is biting the total implementation in such operations.
It’s an interesting read, and a little disappointing.