简体   繁体   中英

Effective usage of dm_db_missing_index_details

How can i effectively use the dm_db_missing_index_details of SQL SERVER databases. Should i need to create all the missing indexes detailed in the table or not and what does equality_columns and inequality_columns means. How can i utilize the equality_columns , inequality_columns and included columns while creating an index out of it (non clustered index).

Sure you don't need to create all the index suggested by dm_db_missing_index_details But it worths to pay attention and check for a possible performance improvement

Equality columns are fields to use for search operations with EQUAL "=" operator

Inequality columns are fields that better suit for range comparisons like BETWEEN or LESS or GREATER THAN etc.

According to your comment following statement can be executed to create a non-clustered index

CREATE NONCLUSTERED INDEX [INDEXNAME] ON [TABLENAME] (
    [EQUALITYCOLUMNNAME], 
    [INEQUALITYCOLUMNNAME]
) 
INCLUDE (
    [INCLUDECOLUMN]
);

Although I added the equality columns and inequality columns in a single index definition, you can think of creating seperate indexes

As a rule, most selective and equality columns should be defined at the begining of the index columns list. Inequality columns follow equality columns in Create Index statement's field list

Please refer to create index statement description

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM