Skip to content

Latest commit

 

History

History
59 lines (46 loc) · 3.84 KB

sys-dm-db-missing-index-groups-transact-sql.md

File metadata and controls

59 lines (46 loc) · 3.84 KB
title description author ms.author ms.date ms.service ms.subservice ms.topic f1_keywords helpviewer_keywords dev_langs monikerRange
sys.dm_db_missing_index_groups (Transact-SQL)
The sys.dm_db_missing_index_groups dynamic management view returns information about indexes that are missing in a specific index group.
rwestMSFT
randolphwest
02/24/2023
sql
system-objects
reference
sys.dm_db_missing_index_groups
sys.dm_db_missing_index_groups_TSQL
dm_db_missing_index_groups
dm_db_missing_index_groups_TSQL
sys.dm_db_missing_index_groups dynamic management view
missing indexes feature [SQL Server], sys.dm_db_missing_index_groups dynamic management view
TSQL
=azuresqldb-current||>=sql-server-2016||>=sql-server-linux-2017||=azuresqldb-mi-current

sys.dm_db_missing_index_groups (Transact-SQL)

[!INCLUDE SQL Server Azure SQL Database Azure SQL Managed Instance]

This DMV returns information about indexes that are missing in a specific index group.

In [!INCLUDE ssazure-sqldb], dynamic management views cannot expose information that would impact database containment or expose information about other databases the user has access to. To avoid exposing this information, every row that contains data that doesn't belong to the connected tenant is filtered out.

Column name Data type Description
index_group_handle int Identifies a missing index group.
index_handle int Identifies a missing index that belongs to the group specified by index_group_handle.

An index group contains only one index.

Remarks

Information returned by sys.dm_db_missing_index_groups is updated when a query is optimized by the query optimizer, and is not persisted. Missing index information is kept only until the database engine is restarted. It may be useful for database administrators to periodically make backup copies of the missing index information if they want to keep it after server recycling. Use the sqlserver_start_time column in sys.dm_os_sys_info to find the last database engine startup time.

Neither column of the output result set is a key, but together they form an index key.

Note

The result set for this DMV is limited to 600 rows. Each row contains one missing index. If you have more than 600 missing indexes, you should address the existing missing indexes so you can then view the newer ones.

Permissions

To query this dynamic management view, users must be granted the VIEW SERVER STATE permission or any permission that implies the VIEW SERVER STATE permission.

Permissions for SQL Server 2022 and later

Requires VIEW SERVER PERFORMANCE STATE permission on the server.

Next steps

Learn more about the missing index feature in the following articles: