WS4: missing-index + plan-warning advise-only recommendations (from collected plans)#1078
Merged
Merged
Conversation
…llected plans Surface the optimizer's missing-index requests and actionable plan warnings as advise-only recommendations, parsed from the ALREADY-collected query plans (collect.query_stats.query_plan_text on Dashboard; query_stats.query_plan_xml in Lite's DuckDB) with the existing ShowPlanParser / PlanAnalyzer — no DMV, no new collection, no schema. - Shared PlanAdvisoryAggregator (PerformanceMonitor.PlanAnalysis): parses a set of plan XMLs and aggregates deduped missing indexes + warnings; a malformed plan is skipped, never aborts the set. Added ParsedPlan.AllWarnings (statement + node-tree) alongside the existing AllMissingIndexes. - Fact collectors (both apps): parse the top 10 collected plans by cost in the analysis window and emit MISSING_INDEX (Value = distinct suggested indexes) + PLAN_WARNING (Value = actionable warnings) facts with numeric metadata. - FactScorer scores each 0.4 when present (else 0); InferenceEngine roots them standalone below the 0.5 threshold (ConfigAdvisoryRootKeys); FactAdvice gives each an advise-only block. - Drill-down enrichment (both apps): re-parses the same top plans to attach the specific suggested indexes (table, impact, CREATE) + warnings to the finding DrillDown -- Fact.Metadata is numeric only, so the strings live there (same pattern as WS3 autogrowth's alter_statement). Runs above the 0.5 display gate, like the config drill-downs. Advise-only -- no RemediationAction/handler/Apply (creating indexes / rewriting queries is a DBA judgement call). Dashboard.Tests 445 (+11), Lite.Tests 362 (no regression); both apps build clean. The parser is the proven production one (Plan Viewer / bad-actor drill-down); WS4's aggregator resilience is unit-tested and parse->emit is exercised by the live analysis path. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
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.
What
Surfaces the optimizer's missing-index requests and actionable plan warnings as advise-only recommendations — parsed from the already-collected query plans with the existing
ShowPlanParser/PlanAnalyzer. No DMV, no new collection, no schema.How
PlanAdvisoryAggregator(PerformanceMonitor.PlanAnalysis): parses a set of plan XMLs → deduped missing indexes + warnings; a malformed plan is skipped (never aborts the batch). AddedParsedPlan.AllWarnings(statement + node-tree) next to the existingAllMissingIndexes.MISSING_INDEX/PLAN_WARNINGfacts (numeric metadata: counts, max impact, critical count). Dashboard readscollect.query_stats.query_plan_text(DECOMPRESS); Lite readsquery_stats.query_plan_xml.ConfigAdvisoryRootKeys); advise-onlyFactAdviceblocks.CREATE) + warnings to the finding'sDrillDown—Fact.Metadatais numeric-only, so the strings live there (the WS3-autogrowth pattern). Runs above the 0.5 display gate.Advise-only — no
RemediationAction/handler/Apply (creating indexes / rewriting queries is a DBA judgement call).Verification
Base is
feature/ws5-lpim-ifi-dump-facts(#1076), notdev— it sharesFactScorer/FactAdvice/InferenceEngine. Merge #1076 first, then this retargets todevcleanly.🤖 Generated with Claude Code