From b22a47691f8405b4d695ffc54ad36b5ebcc6651a Mon Sep 17 00:00:00 2001 From: Erik Darling <2136037+erikdarlingdata@users.noreply.github.com> Date: Fri, 27 Feb 2026 06:03:55 -0500 Subject: [PATCH] Rule 8: Lower parallel skew thresholds and remove 4-thread minimum DOP 2 with all work on one thread is still skew worth flagging. Threshold is now 75% at DOP 2, 50% at DOP 3+. Removed the >= 4 thread requirement that prevented detection at low DOP. Co-Authored-By: Claude Opus 4.6 --- Dashboard/Services/PlanAnalyzer.cs | 3 ++- Lite/Services/PlanAnalyzer.cs | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/Dashboard/Services/PlanAnalyzer.cs b/Dashboard/Services/PlanAnalyzer.cs index 6c3bdc23..ae156aae 100644 --- a/Dashboard/Services/PlanAnalyzer.cs +++ b/Dashboard/Services/PlanAnalyzer.cs @@ -304,7 +304,8 @@ private static void AnalyzeNode(PlanNode node, PlanStatement stmt) { var maxThread = node.PerThreadStats.OrderByDescending(t => t.ActualRows).First(); var skewRatio = (double)maxThread.ActualRows / totalRows; - if (skewRatio >= 0.9 && node.PerThreadStats.Count >= 4) + var skewThreshold = node.PerThreadStats.Count == 2 ? 0.75 : 0.50; + if (skewRatio >= skewThreshold) { node.Warnings.Add(new PlanWarning { diff --git a/Lite/Services/PlanAnalyzer.cs b/Lite/Services/PlanAnalyzer.cs index 9db6f722..0aec572b 100644 --- a/Lite/Services/PlanAnalyzer.cs +++ b/Lite/Services/PlanAnalyzer.cs @@ -304,7 +304,8 @@ private static void AnalyzeNode(PlanNode node, PlanStatement stmt) { var maxThread = node.PerThreadStats.OrderByDescending(t => t.ActualRows).First(); var skewRatio = (double)maxThread.ActualRows / totalRows; - if (skewRatio >= 0.9 && node.PerThreadStats.Count >= 4) + var skewThreshold = node.PerThreadStats.Count == 2 ? 0.75 : 0.50; + if (skewRatio >= skewThreshold) { node.Warnings.Add(new PlanWarning {