未使用 Table 的索引碎片是否增加?

Does Index Fragmentation of an Unused Table Increases?

我是SQL Server数据库的新手,版本是SQL Server 2017。我想知道,一个长期未使用的索引碎片table时不时增加?

*Long-time-unused table是指table很久没有activity,没有插入,没有更新,没有删除table.

如果是,请问是什么原因造成的?

谢谢:)

有两种类型的碎片 - 内部(页面完整)和外部(页面排序)。

缩小数据文件会增加整个数据库的外部碎片,您可以使用TRUNCATEONLY选项避免它,参见以下link:

https://www.mssqltips.com/sqlservertip/4368/execute-sql-server-dbcc-shrinkfile-without-causing-index-fragmentation/