Skip to content

Commit 82f92af

Browse files
authored
Merge pull request BrentOzarULTD#3908 from BrentOzarULTD/copilot/update-tempdb-data-file-thresholds
sp_Blitz: replace fixed TempDB file-count warning with CPU-relative threshold
2 parents f8bd086 + c9e7161 commit 82f92af

2 files changed

Lines changed: 6 additions & 4 deletions

File tree

Documentation/sp_Blitz_Checks_by_Priority.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,7 @@ If you want to add a new one, start at 276.
135135
| 170 | File Configuration | Multiple Log Files on One Drive | https://www.BrentOzar.com/go/manylogs | 41 |
136136
| 170 | File Configuration | System Database on C Drive | https://www.BrentOzar.com/go/drivec | 24 |
137137
| 170 | File Configuration | TempDB Governor Config Problem | https://www.BrentOzar.com/go/tempdbrg | 271 |
138-
| 170 | File Configuration | TempDB Has >16 Data Files | https://www.BrentOzar.com/go/tempdb | 175 |
138+
| 170 | File Configuration | TempDB Has a Lot of Data Files | https://www.BrentOzar.com/go/tempdb | 175 |
139139
| 170 | File Configuration | TempDB Only Has 1 Data File | https://www.BrentOzar.com/go/tempdb | 40 |
140140
| 170 | File Configuration | TempDB Unevenly Sized Data Files | https://www.BrentOzar.com/go/tempdb | 183 |
141141
| 170 | File Configuration | Uneven File Growth Settings in One Filegroup | https://www.BrentOzar.com/go/grow | 42 |

sp_Blitz.sql

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5784,12 +5784,14 @@ IF NOT EXISTS ( SELECT 1
57845784
'TempDB' AS DatabaseName ,
57855785
170 AS Priority ,
57865786
'File Configuration' AS FindingsGroup ,
5787-
'TempDB Has >16 Data Files' AS Finding ,
5787+
'TempDB Has a Lot of Data Files' AS Finding ,
57885788
'https://www.brentozar.com/go/tempdb' AS URL ,
5789-
'Woah, Nelly! TempDB has ' + CAST(COUNT_BIG(*) AS VARCHAR(30)) + '. Did you forget to terminate a loop somewhere?' AS Details
5789+
'This server has ' + CAST(si.cpu_count AS VARCHAR(30)) + ' cores and ' + CAST(COUNT_BIG(*) AS VARCHAR(30)) + ' TempDB data files.' AS Details
57905790
FROM sys.[master_files] AS [mf]
5791+
CROSS JOIN sys.dm_os_sys_info AS [si]
57915792
WHERE [mf].[database_id] = 2 AND [mf].[type] = 0
5792-
HAVING COUNT_BIG(*) > 16;
5793+
HAVING COUNT_BIG(*) > 8
5794+
AND COUNT_BIG(*) * 2 > MAX([si].[cpu_count]);
57935795
END;
57945796

57955797
IF NOT EXISTS ( SELECT 1

0 commit comments

Comments
 (0)