SQL Server Index Tuning - index missing

In this article we will focus on the dynamic view of the law given the index database found missing. For the adjustment of the index and the new range will not be set forth herein, the follow-up will continue to share relevant experience.

sys.dm_db_missing_index_details missing index details, including equal columns, ranging from columns and columns contain, execute the following script, and view the results

USE WideWorldImporters;
GO
SELECT * FROM sys.dm_db_missing_index_details;


From the results, all databases, or missing index table indexed view are listed. But whether the listed missing indexes are directly built up it? Obviously, doing so may not only fail to improve performance, and may cause performance degradation. Such as,

Some queries are sporadic, the utilization rate is very low, and the corresponding table and a large number of inserts, updates, and so on;

Or create some indexes to enhance the performance itself, not much;

Or, missing column index, stored in some index has been partially contained, according to information given to create the missing index, the index will result in redundancy.

Combining these circumstances, if we want to fill a missing index, then we also need to know the missing frequencies used by indexes, and other information to enhance performance. Dynamic view sys.dm_db_missing_index_group_stats given the information we need, let's give the status of the missing index

The OBJECT_NAME the SELECT (m.OBJECT_ID) tableName, equality_columns, inequality_columns, included_columns
, unique_compiles, user_seeks, user_scans, avg_user_impact, avg_system_impact
the FROM m sys.dm_db_missing_index_details
the LEFT the JOIN sys.dm_db_missing_index_groups G = the ON m.index_handle g.index_handle
the LEFT the JOIN sys.dm_db_missing_index_group_stats the ON S = s.group_handle g.index_group_handle
the WHERE m.database_id = DB_ID ();
we can based on the results of the above query, the user search, user scanning frequency and impact of user performance, to determine the initial need to index. It will eventually be based on already existing index, and the index created some rules to determine the need for new indexes created.

Guess you like

Origin www.cnblogs.com/footleg/p/12053812.html