Tag: "fragmentierung"

Indexfragmentierung anzeigen

Posted on Sep 1, 2008 von in SQL Server
SELECT 
DB_NAME(IXStats.database_id) AS DatabaseName,
OBJECT_NAME (IXStats.[object_id]) AS TabellenName,
SIX.[Name] AS IndexName,
IXStats.avg_fragmentation_in_percent,
IXStats.index_type_desc
FROM
sys.dm_db_index_physical_stats (DB_ID(), NULL, NULL, NULL, NULL) IXStats
JOIN
sys.indexes SIX ON IXStats.[object_id] = SIX.[object_id] AND IXStats.index_id = SIX.index_id
WHERE
IXStats.database_id = DB_ID()
ORDER BY
IXStats.avg_fragmentation_in_percent DESC