You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: Documentation/sp_BlitzCache Checks by Priority.md
+2-1Lines changed: 2 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -66,13 +66,14 @@ If you want to add a new check, start at 63
66
66
| 150 | Expensive Index Spool | You have an index spool, this is usually a sign that there's an index missing somewhere. |https://www.brentozar.com/blitzcache/eager-index-spools/| 54 | No |
67
67
| 150 | Index Spools Many Rows | You have an index spool that spools more rows than the query returns |https://www.brentozar.com/blitzcache/eager-index-spools/| 55 | No |
68
68
| 100 | Potentially bad cardinality estimates | Estimated rows are different from average rows by a factor of 10000 |https://www.brentozar.com/blitzcache/bad-estimates/| 56 | Yes |
69
-
| 200 | Is Paul White Electric? | This query has a Switch operator in it! |http://sqlblog.com/blogs/paul_white/archive/2013/06/11/hello-operator-my-switch-is-bored.aspx| 998 | Yes |
69
+
| 200 | Is Paul White Electric? | This query has a Switch operator in it! |https://www.sql.kiwi/2013/06/hello-operator-my-switch-is-bored.html| 998 | Yes |
70
70
| 200 | Database Level Statistics | Database has stats updated 7 days ago with more than 100k modifications |https://www.brentozar.com/blitzcache/stale-statistics/| 999 | No |
71
71
| 200 | Row Goals | This query had row goals introduced |https://www.brentozar.com/go/rowgoals/| 58 | Yes |
72
72
| 100 | tempdb Spills | This query spills >500mb to tempdb on average |https://www.brentozar.com/blitzcache/tempdb-spills/| 59 | No |
73
73
| 100 | MSTVFs | These have many of the same problems scalar UDFs have |http://brentozar.com/blitzcache/tvf-join/| 60 | No |
74
74
| 100 | Many to Many Merge | These use secret worktables that could be doing lots of reads | Blog not published yet | 61 | Yes |
75
75
| 50 | Non-SARGable queries | Queries may have non-SARGable predicates |http://brentozar.com/go/sargable| 62 | No |
76
+
| 50 | Selects w/ Writes | Read queries are causing writes |https://dba.stackexchange.com/questions/191825/| This is thrown when reads cause writes that are not already flagged as big spills (2016+) or index spools | No |
76
77
| 254 | Plan Cache Information | Breaks cache down by creation date (24/4/1 hrs) | None | 999 | No |
77
78
| 255 | Global Trace Flags Enabled | You have Global Trace Flags enabled on your server |https://www.brentozar.com/blitz/trace-flags-enabled-globally/| 1000 | No |
78
79
| 255 | Need more help? | Paste your plan on the internet! |http://pastetheplan.com| 2147483646 | No |
N'Data processing and display order. @SortOrder will still be used, even when preparing output for a table or for excel. Possible values are: "CPU", "Reads", "Writes", "Duration", "Executions", "Recent Compilations", "Memory Grant", "Spills". Additionally, the word "Average" or "Avg" can be used to sort on averages rather than total. "Executions per minute" and "Executions / minute" can be used to sort by execution per minute. For the truly lazy, "xpm" can also be used. Note that when you use all or all avg, the only parameters you can use are @Top and @DatabaseName. All others will be ignored.'
349
+
N'Data processing and display order. @SortOrder will still be used, even when preparing output for a table or for excel. Possible values are: "CPU", "Reads", "Writes", "Duration", "Executions", "Recent Compilations", "Memory Grant", "Spills", "Query Hash". Additionally, the word "Average" or "Avg" can be used to sort on averages rather than total. "Executions per minute" and "Executions / minute" can be used to sort by execution per minute. For the truly lazy, "xpm" can also be used. Note that when you use all or all avg, the only parameters you can use are @Top and @DatabaseName. All others will be ignored.'
349
350
350
351
UNION ALL
351
352
SELECTN'@UseTriggersAnyway',
@@ -611,8 +612,9 @@ BEGIN
611
612
UNION ALL
612
613
SELECTN'MaxUsedGrantKB',
613
614
N'BIGINT',
614
-
N'The maximum used memory grant the query received in kb.';
615
+
N'The maximum used memory grant the query received in kb.'
615
616
617
+
UNION ALL
616
618
SELECTN'MinSpills',
617
619
N'BIGINT',
618
620
N'The minimum amount this query has spilled to tempdb in 8k pages.'
SET @plans_triggers_select_list +=N' COALESCE(deqps.query_plan,qp.query_plan) AS QueryPlan, '+ @nl ;
2048
+
SET @plans_triggers_select_list +=N'CASE WHEN DATALENGTH(COALESCE(deqps.query_plan,'''')) > DATALENGTH(COALESCE(qp.query_plan,'''')) THEN deqps.query_plan ELSE qp.query_plan END AS QueryPlan, '+ @nl ;
2042
2049
END;
2043
2050
ELSE
2044
2051
BEGIN
@@ -2184,7 +2191,7 @@ BEGIN
2184
2191
2185
2192
IF @VersionShowsAirQuoteActualPlans =1
2186
2193
BEGIN
2187
-
SET @sql +=N' COALESCE(deqps.query_plan,qp.query_plan) AS QueryPlan, '+ @nl ;
2194
+
SET @sql +=N'CASE WHEN DATALENGTH(COALESCE(deqps.query_plan,'''')) > DATALENGTH(COALESCE(qp.query_plan,'''')) THEN deqps.query_plan ELSE qp.query_plan END AS QueryPlan, '+ @nl ;
2188
2195
END
2189
2196
ELSE
2190
2197
BEGIN
@@ -3312,6 +3319,25 @@ JOIN spools sp
3312
3319
ONsp.QueryHash=b.QueryHash
3313
3320
OPTION (RECOMPILE);
3314
3321
3322
+
RAISERROR('Checking for selects that cause non-spill and index spool writes', 0, 1) WITHNOWAIT;
3323
+
WITH XMLNAMESPACES (
3324
+
'http://schemas.microsoft.com/sqlserver/2004/07/showplan'AS p )
CASE WHEN is_nonsargable = 1 THEN '', 62'' ELSE '''' END +
4807
4835
CASE WHEN CompileTime > 5000 THEN '', 63 '' ELSE '''' END +
4808
4836
CASE WHEN CompileCPU > 5000 THEN '', 64 '' ELSE '''' END +
4809
-
CASE WHEN CompileMemory > 1024 AND ((CompileMemory) / (1 * CASE WHEN MaxCompileMemory = 0 THEN 1 ELSE MaxCompileMemory END) * 100.) >= 10. THEN '', 65 '' ELSE '''' END
4837
+
CASE WHEN CompileMemory > 1024 AND ((CompileMemory) / (1 * CASE WHEN MaxCompileMemory = 0 THEN 1 ELSE MaxCompileMemory END) * 100.) >= 10. THEN '', 65 '' ELSE '''' END +
4838
+
CASE WHEN select_with_writes > 0 THEN '', 66'' ELSE '''' END
0 commit comments