E.g., — Get fragmentation info for all indexes above a certain size in the current database (Query 61) (Index Fragmentation)
— Note: This query could take some time on a very large database
SELECT ‘Q61’ AS Q61, DB_NAME(ps.database_id) AS [Database Name], OBJECT_NAME(ps.OBJECT_ID) AS [Object Name],
i.name AS [Index Name], ps.index_id, ps.index_type_desc, ps.avg_fragmentation_in_percent,
ps.fragment_count, ps.page_count, i.fill_factor, i.has_filter, i.filter_definition
FROM …
And perhaps you could label each spreadsheet tab with the query number in parentheses…? E.g., “Index Fragmentation (Q61)”
My first time on a new-to-me server meant running everything and transposing results. That became a little confusing after the first 30 or so queries.
REALLY appreciate these queries, Glenn, they’ve shed more light on a poorly performing server than the “professionals” engaged a few weeks back.
]]>