Posts

Showing posts from August, 2024

Index Usage

 SELECT  i.name AS IndexName,             OBJECT_NAME(i.object_id) AS TableName,               i.type_desc AS IndexType,               s.user_seeks,               s.user_scans,               s.user_lookups,               s.user_updates,               s.last_user_seek,               s.last_user_scan,               s.last_user_lookup,               s.last_user_update FROM  sys.indexes AS i JOIN  sys.dm_db_index_usage_stats AS s  ON i.object_id = s.object_id  AND i.index_id = s.index_id WHERE  OBJECTPROPERTY(i.object_id, 'IsUserTable') = 1         ...