Solved

DMV and Create missing indexes

Posted on 2011-02-15
3
1,051 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
Comment Utility
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
Comment Utility
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
Comment Utility
Thanks bibi
0

Featured Post

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

Everyone has problem when going to load data into Data warehouse (EDW). They all need to confirm that data quality is good but they don't no how to proceed. Microsoft has provided new task within SSIS 2008 called "Data Profiler Task". It solve th…
Ever needed a SQL 2008 Database replicated/mirrored/log shipped on another server but you can't take the downtime inflicted by initial snapshot or disconnect while T-logs are restored or mirror applied? You can use SQL Server Initialize from Backup…
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
This videos aims to give the viewer a basic demonstration of how a user can query current session information by using the SYS_CONTEXT function

763 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

Need Help in Real-Time?

Connect with top rated Experts

6 Experts available now in Live!

Get 1:1 Help Now