You are here
Home > Posts tagged "sys.dm_db_partition_stats"

Index Size and Usage

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(, 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…