Pregunta

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/

¿Fue útil?

Solución

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.

Licenciado bajo: CC-BY-SA con atribución
No afiliado a dba.stackexchange
scroll top