2009-05-12

MS CRM database fragmentation

If your CRM is very slow, then check the indexes fragmentation.
And if received table was not empty then you must rebuild the indexes.


USE AdventureBase
GO
SELECT a.index_id, name, avg_fragmentation_in_percent
FROM sys.dm_db_index_physical_stats (DB_ID(N'AdventureBase'), NULL,NULL, NULL, NULL) AS a
JOIN sys.indexes AS b ON a.object_id = b.object_id AND a.index_id = b.index_id
where avg_fragmentation_in_percent>30
GO

Комментариев нет: