SQL Server Index Fragmentation: dm_db_index_physical_stats
Apr 3, 2026 / · 6 min read · sql server index maintenance sql scripts sys.dm_db_index_physical_stats fragmentation database administration performance maintenance scripts indexes rebuild reorganize ·Report Index Fragmentation Across All Tables in SQL Server This script queries sys.dm_db_index_physical_stats to report external and internal fragmentation for every index in the current database, filtering to indexes with significant fragmentation and enough pages to make maintenance worthwhile. Purpose and Overview …
Read MoreSQL Server Unused Indexes: sys.dm_db_index_usage_stats
Apr 1, 2026 / · 7 min read · sql server performance sql scripts sys.dm_db_index_usage_stats index maintenance database administration nonclustered indexes query tuning maintenance scripts indexes ·Find Unused Nonclustered Indexes in SQL Server This script queries sys.dm_db_index_usage_stats to identify nonclustered indexes that have never been used by any read operation since the last SQL Server restart, yet still carry write overhead with every INSERT, UPDATE, and DELETE on the table. Purpose and Overview Every …
Read More