Frage

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/

War es hilfreich?

Lösung

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.

Lizenziert unter: CC-BY-SA mit Zuschreibung
Nicht verbunden mit dba.stackexchange
scroll top