tigertoolbox icon indicating copy to clipboard operation
tigertoolbox copied to clipboard

Querying the plan cache for missing indexes vs. multiple rows per plan

Open m60freeman opened this issue 5 years ago • 0 comments

Reference: https://github.com/microsoft/tigertoolbox/tree/master/Mining-PlanCache#querying-the-plan-cache-for-missing-indexes

I think this query produces inaccurate results for versions of SQL Server that can provide multiple index recommendations for a single plan, as it can combine columns from indexes needed in different tables into the one row. This also means that it won't have a row in the result set for a table mentioned in any missing index after the first one in any given plan. This situation can be seen when c1.value('(//MissingIndex/@Table)[2]', 'SYSNAME') IS NOT NULL.

m60freeman avatar Oct 16 '19 19:10 m60freeman