Skip to content

Commit a96b465

Browse files
Merge pull request #192 from erikdarlingdata/fix/rule3-actionable
Fix Rule 3: CouldNotGenerateValidParallelPlan stays Warning
2 parents 5c5c4ff + 68ff836 commit a96b465

1 file changed

Lines changed: 5 additions & 3 deletions

File tree

src/PlanViewer.Core/Services/PlanAnalyzer.cs

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -141,14 +141,16 @@ private static void AnalyzeStatement(PlanStatement stmt, AnalyzerConfig cfg)
141141
_ => stmt.NonParallelPlanReason
142142
};
143143

144-
// Only warn (not info) when the user explicitly forced serial execution
145-
var isExplicit = stmt.NonParallelPlanReason is "MaxDOPSetToOne" or "QueryHintNoParallelSet";
144+
// Warn when the user forced serial or something in the query blocks parallelism.
145+
// Info only for passive reasons (cost below threshold, edition limitation).
146+
var isActionable = stmt.NonParallelPlanReason is "MaxDOPSetToOne"
147+
or "QueryHintNoParallelSet" or "CouldNotGenerateValidParallelPlan";
146148

147149
stmt.PlanWarnings.Add(new PlanWarning
148150
{
149151
WarningType = "Serial Plan",
150152
Message = $"Query running serially: {reason}.",
151-
Severity = isExplicit ? PlanWarningSeverity.Warning : PlanWarningSeverity.Info
153+
Severity = isActionable ? PlanWarningSeverity.Warning : PlanWarningSeverity.Info
152154
});
153155
}
154156

0 commit comments

Comments
 (0)