-
Notifications
You must be signed in to change notification settings - Fork 997
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
SQL Server 2019: dm_db_missing_index_group_stats_query DMV #2185
Comments
Any feedback on this from out there in the world? |
Better late than ever, but I would add it to BlitzIndex in order to quickly get an idea about the queries that boop the index |
Erik - do you still wanna do this? If not, I'll close it. |
Yeah, totally. I was hoping for some more feedback on it from the community, but I'll figure something out. |
Adds a sample query plan to Mode 3 out put and table-level output. Working on #2185.
…g_index_query_plans #2185 sp_BlitzIndex missing index plans
I added a first step on it. The #MissingIndexes table now has a sample_query_plan column. I'm taking the:
This particular PLAN may not actually be the one that's producing the missing index request - but the QUERY should be the same. If you've got multiple queries producing the plan, this isn't going to give you all of them either, just one as a starting point. If you call sp_Blitz @TableName = 'Users', the missing index section has this sample plan at the far right. If you call sp_Blitz @mode = 3, this is a new column on the far right. Things left that someone else can do if they want:
|
Just making a note in here in case anybody tries to test this - the current state is a disaster, and it almost never shows the right query. I have fixing to do in there. |
Just FYI for readers - Erik asked Microsoft to document the DMV: https://github.com/MicrosoftDocs/sql-docs/issues/5862 |
It's going really well, too 😔 |
oh, wait, the inner correlation is correct. if we just get rid of the outer one all together it's fine. |
Eureka! That's it. Nice work, sir. Merging into the dev branch, will be in the April release with credit to you in the release notes. |
Is your feature request related to a problem? Please describe.
SQL Server 2019 introduced a new DMV, called
dm_db_missing_index_group_stats_query
that includes some interesting columns. It's not documented so far, but it provides some information that can be used to tie missing index requests to queries.Describe the solution you'd like
I'd like to get this added, but I'm not sure which script it makes more sense in, because it involves a crossover.
Either:
Describe alternatives you've considered
dm_db_missing_index_group_stats
because it clears out when query plans go awayquery_more_info
column to BlitzIndex is simple but maybe feels incomplete@Mode = 3
output of BlitzIndex to run a simple plan cache query would probably be doable, but it'd have to either be entirely dynamic, or dump into a#temp
table with a dynamic updateAre you ready to build the code for the feature?
Yes, when there's a decision on approach.
The text was updated successfully, but these errors were encountered: