Reduce SQL Server table fragmentation without adding/dropping a clustered index?

前端 未结 5 663
死守一世寂寞
死守一世寂寞 2021-02-07 21:54

I have a large database (90GB data, 70GB indexes) that\'s been slowly growing for the past year, and the growth/changes has caused a large amount of internal fragmentation not o

5条回答
  •  情话喂你
    2021-02-07 22:13

    You state that you add a clustered index to alleviate the table fragmentation, to then drop it immediately.

    The clustered index removes fragmentation by sorting on the cluster key, but you say that this key would not be possible for future use. This begs the question: why defragment using this key at all?

    It would make sense to create this clustered key and keep it, as you obviously want/need the data sorted that way. You say that data changes would incur data movement penalties that can't be borne; have you thought about creating the index with a lower FILLFACTOR than the default value? Depending upon data change patterns, you could benefit from something as low as 80%. You then have 20% 'unused' space per page, but the benefit of lower page splits when the clustered key values are changed.

    Could that help you?

提交回复
热议问题