diff --git a/Dashboard/Services/PlanAnalyzer.cs b/Dashboard/Services/PlanAnalyzer.cs index ae156aae..5df73609 100644 --- a/Dashboard/Services/PlanAnalyzer.cs +++ b/Dashboard/Services/PlanAnalyzer.cs @@ -75,7 +75,7 @@ private static void AnalyzeStatement(PlanStatement stmt) if (grant.GrantedMemoryKB > 0 && grant.MaxUsedMemoryKB > 0) { var wasteRatio = (double)grant.GrantedMemoryKB / grant.MaxUsedMemoryKB; - if (wasteRatio >= 10 && grant.GrantedMemoryKB > 1024) + if (wasteRatio >= 10 && grant.GrantedMemoryKB >= 1048576) { stmt.PlanWarnings.Add(new PlanWarning { @@ -98,7 +98,7 @@ private static void AnalyzeStatement(PlanStatement stmt) } // Large memory grant with sort/hash guidance - if (grant.GrantedMemoryKB > 102400 && stmt.RootNode != null) + if (grant.GrantedMemoryKB >= 1048576 && stmt.RootNode != null) { var consumers = new List(); FindMemoryConsumers(stmt.RootNode, consumers); @@ -112,7 +112,7 @@ private static void AnalyzeStatement(PlanStatement stmt) { WarningType = "Large Memory Grant", Message = $"Query granted {grantMB:F0} MB of memory.{guidance}", - Severity = grantMB >= 512 ? PlanWarningSeverity.Critical : PlanWarningSeverity.Warning + Severity = grantMB >= 4096 ? PlanWarningSeverity.Critical : PlanWarningSeverity.Warning }); } } diff --git a/Lite/Services/PlanAnalyzer.cs b/Lite/Services/PlanAnalyzer.cs index 0aec572b..803b443b 100644 --- a/Lite/Services/PlanAnalyzer.cs +++ b/Lite/Services/PlanAnalyzer.cs @@ -75,7 +75,7 @@ private static void AnalyzeStatement(PlanStatement stmt) if (grant.GrantedMemoryKB > 0 && grant.MaxUsedMemoryKB > 0) { var wasteRatio = (double)grant.GrantedMemoryKB / grant.MaxUsedMemoryKB; - if (wasteRatio >= 10 && grant.GrantedMemoryKB > 1024) + if (wasteRatio >= 10 && grant.GrantedMemoryKB >= 1048576) { stmt.PlanWarnings.Add(new PlanWarning { @@ -98,7 +98,7 @@ private static void AnalyzeStatement(PlanStatement stmt) } // Large memory grant with sort/hash guidance - if (grant.GrantedMemoryKB > 102400 && stmt.RootNode != null) + if (grant.GrantedMemoryKB >= 1048576 && stmt.RootNode != null) { var consumers = new List(); FindMemoryConsumers(stmt.RootNode, consumers); @@ -112,7 +112,7 @@ private static void AnalyzeStatement(PlanStatement stmt) { WarningType = "Large Memory Grant", Message = $"Query granted {grantMB:F0} MB of memory.{guidance}", - Severity = grantMB >= 512 ? PlanWarningSeverity.Critical : PlanWarningSeverity.Warning + Severity = grantMB >= 4096 ? PlanWarningSeverity.Critical : PlanWarningSeverity.Warning }); } }