Why DMV does not show index on my table
-
12-03-2021 - |
Pergunta
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/
Solução
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 em: CC-BY-SA com atribuição
Não afiliado a dba.stackexchange