Question

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/

Was it helpful?

Solution

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.

Licensed under: CC-BY-SA with attribution
Not affiliated with dba.stackexchange
scroll top