新文章 网摘 文章 随笔 日记

MSSQL自动索引和碎片整理

https://docs.microsoft.com/en-us/sql/relational-databases/system-stored-procedures/sp-updatestats-transact-sql?view=sql-server-ver15

https://github.com/Microsoft/tigertoolbox/tree/master/AdaptiveIndexDefrag

https://github.com/microsoft/tigertoolbox/blob/master/AdaptiveIndexDefrag/usp_AdaptiveIndexDefrag.sql

 

执行上面的usp_AdaptiveIndexDefrag.sql后,制定作业计划,执行类似

EXEC dbo.usp_AdaptiveIndexDefrag @dbScope = 'AdventureWorks2014' 同上,除了它的作用域只是 'AdventureWorks2014' 数据库。

EXEC dbo.usp_AdaptiveIndexDefrag @dbScope = 'AdventureWorks2014', @tblName = 'Production.BillOfMaterials' 与上述相同,但仅作用于 BillOfMaterials 表。

posted @ 2021-06-05 13:42  岭南春  阅读(206)  评论(0)    收藏  举报