Data and Index size doubles after update to primary key in table with millions of rows
Here's the situation:
Using SQL Server 2005, I've went through and updated the primary key (a char(16)) in several tables replacing a good chunk of the first six characters with others. (I'm doing this as part of a data scrubbing project at my job).
Most of these tables contain millions of rows and may have 1 or 2 non-clustered indexes as well.
After doing these updates the data pages used by the data and indexes seem to have doubled thus causing the MDF to double in size as well. I've went through checking several things against another copy of the original database like column data types, collation, used/reserved/unused space and have even created/updated the statistics for everything then ran a shrink on the data. Nothing has helped or hinted at a reason for the increase in size. By the way, the row counts are the same between the two databases so it's not duplicated rows or anything like that.
I have not executed a 'dbcc checkdb' or rebuilt the indexes - these are my last ditch ideas. Has anyone seen something similar to this?
TLDR - Database MDF doubles after updating primary keys of several tables with millions of rows. H开发者_C百科ave checked column data types, row counts, data/index size. Updated stats and tried shrinking. Nothing works. Halp!
You need to rebuild the indexes with your normal fill factor to determine if your page use has been disrupted.
精彩评论