Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions src/PlanViewer.Core/Services/PlanAnalyzer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -141,14 +141,16 @@
_ => stmt.NonParallelPlanReason
};

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

stmt.PlanWarnings.Add(new PlanWarning
{
WarningType = "Serial Plan",
Message = $"Query running serially: {reason}.",
Severity = isExplicit ? PlanWarningSeverity.Warning : PlanWarningSeverity.Info
Severity = isActionable ? PlanWarningSeverity.Warning : PlanWarningSeverity.Info
});
}

Expand Down Expand Up @@ -984,7 +986,7 @@
// Rule 28: Row Count Spool — NOT IN with nullable column
// Pattern: Row Count Spool with high rewinds, child scan has IS NULL predicate,
// and statement text contains NOT IN
if (!cfg.IsRuleDisabled(28) && node.PhysicalOp.Contains("Row Count Spool"))

Check warning on line 989 in src/PlanViewer.Core/Services/PlanAnalyzer.cs

View workflow job for this annotation

GitHub Actions / build-and-test

Dereference of a possibly null reference.

Check warning on line 989 in src/PlanViewer.Core/Services/PlanAnalyzer.cs

View workflow job for this annotation

GitHub Actions / build-and-test

Dereference of a possibly null reference.
{
var rewinds = node.HasActualStats ? (double)node.ActualRewinds : node.EstimateRewinds;
if (rewinds > 10000 && HasNotInPattern(node, stmt))
Expand Down
Loading