File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -75,7 +75,7 @@ private static void AnalyzeStatement(PlanStatement stmt)
7575 if ( grant . GrantedMemoryKB > 0 && grant . MaxUsedMemoryKB > 0 )
7676 {
7777 var wasteRatio = ( double ) grant . GrantedMemoryKB / grant . MaxUsedMemoryKB ;
78- if ( wasteRatio >= 10 && grant . GrantedMemoryKB > 1024 )
78+ if ( wasteRatio >= 10 && grant . GrantedMemoryKB >= 1048576 )
7979 {
8080 stmt . PlanWarnings . Add ( new PlanWarning
8181 {
@@ -98,7 +98,7 @@ private static void AnalyzeStatement(PlanStatement stmt)
9898 }
9999
100100 // Large memory grant with sort/hash guidance
101- if ( grant . GrantedMemoryKB > 102400 && stmt . RootNode != null )
101+ if ( grant . GrantedMemoryKB >= 1048576 && stmt . RootNode != null )
102102 {
103103 var consumers = new List < string > ( ) ;
104104 FindMemoryConsumers ( stmt . RootNode , consumers ) ;
@@ -112,7 +112,7 @@ private static void AnalyzeStatement(PlanStatement stmt)
112112 {
113113 WarningType = "Large Memory Grant" ,
114114 Message = $ "Query granted { grantMB : F0} MB of memory.{ guidance } ",
115- Severity = grantMB >= 512 ? PlanWarningSeverity . Critical : PlanWarningSeverity . Warning
115+ Severity = grantMB >= 4096 ? PlanWarningSeverity . Critical : PlanWarningSeverity . Warning
116116 } ) ;
117117 }
118118 }
Original file line number Diff line number Diff line change @@ -75,7 +75,7 @@ private static void AnalyzeStatement(PlanStatement stmt)
7575 if ( grant . GrantedMemoryKB > 0 && grant . MaxUsedMemoryKB > 0 )
7676 {
7777 var wasteRatio = ( double ) grant . GrantedMemoryKB / grant . MaxUsedMemoryKB ;
78- if ( wasteRatio >= 10 && grant . GrantedMemoryKB > 1024 )
78+ if ( wasteRatio >= 10 && grant . GrantedMemoryKB >= 1048576 )
7979 {
8080 stmt . PlanWarnings . Add ( new PlanWarning
8181 {
@@ -98,7 +98,7 @@ private static void AnalyzeStatement(PlanStatement stmt)
9898 }
9999
100100 // Large memory grant with sort/hash guidance
101- if ( grant . GrantedMemoryKB > 102400 && stmt . RootNode != null )
101+ if ( grant . GrantedMemoryKB >= 1048576 && stmt . RootNode != null )
102102 {
103103 var consumers = new List < string > ( ) ;
104104 FindMemoryConsumers ( stmt . RootNode , consumers ) ;
@@ -112,7 +112,7 @@ private static void AnalyzeStatement(PlanStatement stmt)
112112 {
113113 WarningType = "Large Memory Grant" ,
114114 Message = $ "Query granted { grantMB : F0} MB of memory.{ guidance } ",
115- Severity = grantMB >= 512 ? PlanWarningSeverity . Critical : PlanWarningSeverity . Warning
115+ Severity = grantMB >= 4096 ? PlanWarningSeverity . Critical : PlanWarningSeverity . Warning
116116 } ) ;
117117 }
118118 }
You can’t perform that action at this time.
0 commit comments