Solved

DMV and Create missing indexes

Posted on 2011-02-15
3
1,057 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
  • 2
3 Comments
 
LVL 39

Accepted Solution

by:
lcohan earned 500 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 39

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

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
T-SQL: Episode III - Revenge of The Dude 24 53
Live Storage Vmotion VMs with shared VMDK 10 59
insert wont work in SQL 14 22
Create snapshot on MSSQL 2012 3 20
Introduction SQL Server Integration Services can read XML files, that’s known by every BI developer.  (If you didn’t, don’t worry, I’m aiming this article at newcomers as well.) But how far can you go?  When does the XML Source component become …
This article explains how to reset the password of the sa account on a Microsoft SQL Server.  The steps in this article work in SQL 2005, 2008, 2008 R2, 2012, 2014 and 2016.
Via a live example, show how to shrink a transaction log file down to a reasonable size.
Viewers will learn how the fundamental information of how to create a table.

810 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