gpt4 book ai didi

sql - 重建后索引仍然碎片化(SQL Server)

转载 作者:行者123 更新时间:2023-12-02 08:30:26 25 4
gpt4 key购买 nike

我注意到即使我用例如重建索引

ALTER INDEX IX_WeeklyData_SP_ID ON dbo.WeeklyData
REBUILD WITH (ONLINE = ON) ;

它仍然是支离 splinter 的。我已经注意到这个奇怪的事情好几次了。
我使用的是 Microsoft SQL Server 2008 R2 (SP1)。

这是为什么呢?不应该这个 Action (重建索引)
立即降低索引碎片百分比
(接近于 0 的某个值)?

我在这里注意到了这个问题(看起来是一样的)

Rebuild indexes but still fragmented

但它没有答案。

最佳答案

来自 MSDN:

In general, fragmentation on small indexes is often not controllable. The pages of small indexes are stored on mixed extents. Mixed extents are shared by up to eight objects, so the fragmentation in a small index might not be reduced after reorganizing or rebuilding the index.

此引述来自 Reorganizing and Rebuilding Indexes 上的这篇 MSDN 文章.另一个很好的来源是这篇关于 Understanding Pages and Extents 的 MSDN 文章.

关于sql - 重建后索引仍然碎片化(SQL Server),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/27485819/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com