Repository navigation
Find dbadbmissingindexAdd Find-DbaDbMissingIndex - #10779
Open
deepeshd87 wants to merge 2 commits into
Open
deepeshd87 wants to merge 2 commits into
deepeshd87 wants to merge 2 commits into
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Type of Change
Implements #10770.
Purpose
dbatools has Find-DbaDbDuplicateIndex, Find-DbaDbUnusedIndex, and
Find-DbaDbDisabledIndex, but no missing-index counterpart. This adds a read-only
Find-DbaDbMissingIndex that surfaces suggestions from the sys.dm_db_missing_index_*
DMVs, ranked by impact, with a generated CREATE INDEX statement for review.
Approach (per the design discussed in #10770)
three inputs are returned as their own properties so results can be re-ranked.
(not replacing it) for QueryHash / LastSqlHandle.
collection limit; help notes the counter reset conditions.
requirement, that suggestions are candidates for human review, and links
Invoke-DbaDiagnosticQuery.
Testing
Verified against a seeded fixture on SQL Server 2022: the DMV query, per-database
scoping, the ImpactScore and its inputs, the generated CREATE statement, the SMO
overlap detection, and the 2019+ query-text join (QueryHash/LastSqlHandle, no
double-counting) all return correctly. I wasn't able to run the full in-module Pester
suite locally, so I'm relying on CI for the end-to-end run.
(Second contribution — previously added Find-DbaDbQueryStoreRegression in 2.9.0.)