Como descobrir quais índices MS Sql estão fragmentados
/* Find index fragmentation */SELECT DB_NAME(DATABASE_ID) AS [DatabaseName], OBJECT_NAME(OBJECT_ID) AS TableName, SI.NAME AS IndexName, INDEX_TYPE_DESC AS IndexType, AVG_FRAGMENTATION_IN_PERCENT AS AvgPageFragmentation, PAGE_COUNT AS PageCountsFROM sys.dm_db_index_physical_stats (DB_ID(), NULL, NULL , NULL, N’LIMITED’) …
Continuar lendo