Technical Article

Index Seeks, Scans, and Lookups

,

Change the sort order to sort by say Table name and then Index name.

 

use <mydatabase>
go

selecto.name as 'Table'
,i.name as 'Index'
,i.rowcnt as 'Est Rows'
,u.user_seeks as 'Seeks'
,u.user_scans as 'Scans'
,u.user_lookups as 'Lookups'
fromsys.dm_db_index_usage_stats as u
inner joinsys.sysobjects as o
on u.object_id = o.id
and o.xtype = 'U'
inner joinsys.sysindexes as i
on u.index_id = i.indid
and o.id = i.id
whereu.user_scans > 0
andi.rowcnt >= 1000
order byu.user_scans desc
go

Rate

3.89 (9)

You rated this post out of 5. Change rating

Share

Share

Rate

3.89 (9)

You rated this post out of 5. Change rating