September 23, 2007 at 2:42 pm
Comments posted to this topic are about the item Finding missing indexes in sql server 2005
November 14, 2007 at 3:49 am
Thanks for the sql.
However, why not going through the next step and return the index details at the same time...
Something like
SELECT TOP 20 mid.statement as table_name, equality_columns, inequality_columns, included_columns
, CAST(index_advantage AS INT) AS index_advantage -- cast to hint just to make it more readable
FROM (
SELECT (user_seeks+user_scans) * avg_total_user_cost * (avg_user_impact * 0.01) as index_advantage
, migs.group_handle
FROM sys.dm_db_missing_index_group_stats migs
) as migs_adv,
sys.dm_db_missing_index_groups mig,
sys.dm_db_missing_index_details mid
WHERE migs_adv.group_handle = mig.index_group_handle
AND mig.index_handle = mid.index_handle
ORDER BY index_advantage DESC
August 6, 2008 at 3:11 am
I'm sorry, a bit in the dark. What does the outcome tell me?
Viewing 3 posts - 1 through 2 (of 2 total)
You must be logged in to reply to this topic. Login to reply
This website stores cookies on your computer.
These cookies are used to improve your website experience and provide more personalized services to you, both on this website and through other media.
To find out more about the cookies we use, see our Privacy Policy