문제

I am using this query to get information on an index on a table. I can see the index in SSMS.

select object_name(object_id), *  
from sys.dm_db_index_usage_stats 
where database_id =  DB_ID() and  object_name(object_id) = 'MyTableWithoutSchemaName';

But the result set is empty? How come?

Same thing happens if I use some of the queries from here: https://www.sqlshack.com/how-to-identify-and-monitor-unused-indexes-in-sql-server/

도움이 되었습니까?

해결책

The index won't show up if you haven't touched it since you started your SQL Server. By touched I mean seeked, scanned, or modified.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 dba.stackexchange
scroll top