Posts Tagged: sys.dm_db_index_usage_stats

no-clue

Index Size and Usage

Posted by & filed under , , .

Thought I’d share something I threw together for a client today.  They were looking for index a list of indexes in a database with their associated sizes and usage. SELECT object_name(i.object_id) as table_name ,COALESCE(i.name, space(0)) as index_name ,ps.partition_number ,ps.row_count ,Cast((ps.reserved_page_count * 8)/1024. as decimal(12,2)) as size_in_mb ,COALESCE(ius.user_seeks,0) as user_seeks ,COALESCE(ius.user_scans,0) as user_scans ,COALESCE(ius.user_lookups,0) as user_lookups […]