Click here to monitor SSC
SQLServerCentral is supported by Redgate
 
Log in  ::  Register  ::  Not logged in
 
 
 


Missing Index DMVs not sync


Missing Index DMVs not sync

Author
Message
Mark Salvador
Mark Salvador
Forum Newbie
Forum Newbie (7 reputation)Forum Newbie (7 reputation)Forum Newbie (7 reputation)Forum Newbie (7 reputation)Forum Newbie (7 reputation)Forum Newbie (7 reputation)Forum Newbie (7 reputation)Forum Newbie (7 reputation)

Group: General Forum Members
Points: 7 Visits: 260
Hi guys!

I tried looking for missing index and I used this query:

select * 
from sys.dm_db_missing_index_group_stats as migs
inner join sys.dm_db_missing_index_groups as mig on migs.group_handle = mig.index_group_handle
inner join sys.dm_db_missing_index_details as mid on mig.index_handle = mid.index_handle



I got no result after I run it.

Though I made a separate SELECT statement for each DMVs but I've got results. It seems that sys.dm_db_missing_index_group_stats and sys.dm_db_missing_index_groups were not sync because I run this query with no result:

select * 
from sys.dm_db_missing_index_group_stats as migs
inner join sys.dm_db_missing_index_groups as mig on migs.group_handle = mig.index_group_handle



Does the stats needs to flush or something to make it sync? Appreciate your help in advance.

Thanks!
GSquared
GSquared
SSChampion
SSChampion (14K reputation)SSChampion (14K reputation)SSChampion (14K reputation)SSChampion (14K reputation)SSChampion (14K reputation)SSChampion (14K reputation)SSChampion (14K reputation)SSChampion (14K reputation)

Group: General Forum Members
Points: 14375 Visits: 9729
Try replacing your inner joins with left outer joins and see if you get what you need that way.

- Gus "GSquared", RSVP, OODA, MAP, NMVP, FAQ, SAT, SQL, DNA, RNA, UOI, IOU, AM, PM, AD, BC, BCE, USA, UN, CF, ROFL, LOL, ETC
Property of The Thread

"Nobody knows the age of the human race, but everyone agrees it's old enough to know better." - Anon
Mark Salvador
Mark Salvador
Forum Newbie
Forum Newbie (7 reputation)Forum Newbie (7 reputation)Forum Newbie (7 reputation)Forum Newbie (7 reputation)Forum Newbie (7 reputation)Forum Newbie (7 reputation)Forum Newbie (7 reputation)Forum Newbie (7 reputation)

Group: General Forum Members
Points: 7 Visits: 260
When I left join them like this:

select * 
from sys.dm_db_missing_index_group_stats AS migs
left JOIN sys.dm_db_missing_index_groups AS mig ON migs.group_handle = mig.index_group_handle
left JOIN sys.dm_db_missing_index_details AS mid ON mig.index_handle = mid.index_handle



I got data coming from dm_db_missing_index_group_stats but got NULL result in sys.dm_db_missing_index_groups and sys.dm_db_missing_index_details.

I have result though when I make a join between sys.dm_db_missing_index_groups and sys.dm_db_missing_index_details.

I am suspecting that dm_db_missing_index_group_stats could be corrupted or something.
GSquared
GSquared
SSChampion
SSChampion (14K reputation)SSChampion (14K reputation)SSChampion (14K reputation)SSChampion (14K reputation)SSChampion (14K reputation)SSChampion (14K reputation)SSChampion (14K reputation)SSChampion (14K reputation)

Group: General Forum Members
Points: 14375 Visits: 9729
Have you read the MSDN article on using that query? It's entirely possible it simply doesn't have the data in it that you are looking for.

- Gus "GSquared", RSVP, OODA, MAP, NMVP, FAQ, SAT, SQL, DNA, RNA, UOI, IOU, AM, PM, AD, BC, BCE, USA, UN, CF, ROFL, LOL, ETC
Property of The Thread

"Nobody knows the age of the human race, but everyone agrees it's old enough to know better." - Anon
alen teplitsky
alen teplitsky
SSCommitted
SSCommitted (1.6K reputation)SSCommitted (1.6K reputation)SSCommitted (1.6K reputation)SSCommitted (1.6K reputation)SSCommitted (1.6K reputation)SSCommitted (1.6K reputation)SSCommitted (1.6K reputation)SSCommitted (1.6K reputation)

Group: General Forum Members
Points: 1595 Visits: 4621
Mark Salvador (2/5/2009)
When I left join them like this:

select * 
from sys.dm_db_missing_index_group_stats AS migs
left JOIN sys.dm_db_missing_index_groups AS mig ON migs.group_handle = mig.index_group_handle
left JOIN sys.dm_db_missing_index_details AS mid ON mig.index_handle = mid.index_handle



I got data coming from dm_db_missing_index_group_stats but got NULL result in sys.dm_db_missing_index_groups and sys.dm_db_missing_index_details.

I have result though when I make a join between sys.dm_db_missing_index_groups and sys.dm_db_missing_index_details.

I am suspecting that dm_db_missing_index_group_stats could be corrupted or something.


is the null on the equality column? i've read that it means the query is using the between operator
Bhuvnesh
Bhuvnesh
SSCrazy
SSCrazy (2.9K reputation)SSCrazy (2.9K reputation)SSCrazy (2.9K reputation)SSCrazy (2.9K reputation)SSCrazy (2.9K reputation)SSCrazy (2.9K reputation)SSCrazy (2.9K reputation)SSCrazy (2.9K reputation)

Group: General Forum Members
Points: 2924 Visits: 4076
Mark Salvador (2/5/2009)
I tried looking for missing index and I used this query:
but why are you looking for indexes in this DMV. ? did you get any bad performance from any script/SP ? or just to learning prospect?

-------Bhuvnesh----------
I work only to learn Sql Server...though my company pays me for getting their stuff done;-)
Go


Permissions

You can't post new topics.
You can't post topic replies.
You can't post new polls.
You can't post replies to polls.
You can't edit your own topics.
You can't delete your own topics.
You can't edit other topics.
You can't delete other topics.
You can't edit your own posts.
You can't edit other posts.
You can't delete your own posts.
You can't delete other posts.
You can't post events.
You can't edit your own events.
You can't edit other events.
You can't delete your own events.
You can't delete other events.
You can't send private messages.
You can't send emails.
You can read topics.
You can't vote in polls.
You can't upload attachments.
You can download attachments.
You can't post HTML code.
You can't edit HTML code.
You can't post IFCode.
You can't post JavaScript.
You can post emoticons.
You can't post or upload images.

Select a forum

































































































































































SQLServerCentral


Search