Quantcast
Channel: SQL Server Database Engine forum
Viewing all articles
Browse latest Browse all 15264

Partition split question

$
0
0

I've recently inherited a database that has a very large table partitioned by month(each in its own filegroup).  Unfortunately, new partitions have not been added, so the last partition has grown very large.  I'm new to partitioning so I thought the first thing I should do was create an empty partition for any new data that was loaded.  The partition function is a range left and the last partition boundary is N'2011-01-31T00:00:00.000'.  The maximum date in the table is 2012-11-30 00:00:00.000.   So obviously there's a lot of data in the last partition.   I thought that splitting the range at N'2012-11-30T00:00:00.000' would provide an empty partition that could house December 2012 data.  But before that, not knowing for sure if there would be any data moveement, I tried creating an empty partition using a split at N'2013-1-31T00:00:00.000' knowing that I didn't have any 2013 data.

Needless to say, I had to cancel this attempt after 4 hours(plus 2 hours after the cancel) and much log growth.  I've read that splitting and merging partitions could be a time consuming task, but why would there be that much activity if there is no data movement in the split. 

I've also read about "alter table switch" and will probably try that method to switch out the last partiton and then split the partitions as needed.  I assume with this method I'd need 2 working tables for the actual data move.  One to hold the partiton that's switched out and one used to hold data to be switched in.

Any help with this is greatly appreciated.


Viewing all articles
Browse latest Browse all 15264

Trending Articles