?
Solved

DMV and Create missing indexes

Posted on 2011-02-15
3
Medium Priority
?
1,081 Views
Last Modified: 2012-05-11
Hello,

I have executed a query that use dmv for finding missing indexes.
SELECT  TOP 25
        [Total Cost]  = ROUND(avg_total_user_cost * avg_user_impact * (user_seeks + user_scans),0)
        , avg_user_impact
        , TableName = statement
        , [EqualityUsage] = equality_columns
        , [InequalityUsage] = inequality_columns
        , [Include Columns] = included_columns
FROM        sys.dm_db_missing_index_groups g
INNER JOIN    sys.dm_db_missing_index_group_stats s
       ON s.group_handle = g.index_group_handle
INNER JOIN    sys.dm_db_missing_index_details d
       ON d.index_handle = g.index_handle
ORDER BY [Total Cost] DESC;

Does I have to create the index with the columns in the equality_usage?

Thanks

bibi
0
Comment
Question by:bibi92
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
3 Comments
 
LVL 40

Accepted Solution

by:
lcohan earned 2000 total points
ID: 34897045
Although there is nothing wrong with your query I suggest use the free Microsoft "SQL Server 2005 Performance Dashboard Reports" where you have a performance_dashboard_main report that has exactly what you need "Missing Indexes" at the database level. I use it and trust it more than just queries against SQL sys objects and it is built by Microsoft for SQL.

SQL Server 2005 Performance Dashboard Reports
http://www.microsoft.com/downloads/en/details.aspx?FamilyID=1d3a4a0d-7e0c-4730-8204-e419218c1efc
0
 
LVL 40

Expert Comment

by:lcohan
ID: 34897127
Just check out the attachment to see what info you get out of it plus you can export it to Excel(like I did), sort by any column in the heading, get the SQL stmnt to create the index - is all in there and worth to use it.


MissingIndexes.xls
0
 

Author Closing Comment

by:bibi92
ID: 34901660
Thanks bibi
0

Featured Post

Moving data to the cloud? Find out if you’re ready

Before moving to the cloud, it is important to carefully define your db needs, plan for the migration & understand prod. environment. This wp explains how to define what you need from a cloud provider, plan for the migration & what putting a cloud solution into practice entails.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Why is this different from all of the other step by step guides?  Because I make a living as a DBA and not as a writer and I lived through this experience. Defining the name: When I talk to people they say different names on this subject stuff l…
In the first part of this tutorial we will cover the prerequisites for installing SQL Server vNext on Linux.
Using examples as well as descriptions, and references to Books Online, show the different Recovery Models available in SQL Server and explain, as well as show how full, differential and transaction log backups are performed
Via a live example, show how to extract insert data into a SQL Server database table using the Import/Export option and Bulk Insert.
Suggested Courses

765 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question