sql-servertempdb

TempDB with big files - Performance issue


I have a TEMPDB database with 8 files but, they have different sizes which is not recommended, as follow:

TempDB Files

I have a plan to resize to the same size as recommended with 20GB each, the TEMPDB total will be 160GB. My question is, if the SQL Server is executing an operation which need 23GB, will the remaining 3GB be split to another file or the files will grow to accommodate the operation in just 1 tempdb file?

If the files grow, instead of 160GB I will end with 184GB just because of 3 GB..


Solution

  • My question is, if the SQL Server is executing an operation which need 23GB, will the remaining 3GB be split to another file or the files will grow to accommodate the operation in just 1 tempdb file?

    SQL Server uses proportional fill algorithm to fill up data files, this means it will try to spread the data across all your files depending on the amount of free space in those files: the file with most free space will receive most of the data.

    If all your files will be of equal size, and you have 9 file, then 23Gb will be evenly distributed among these 9 files, about 2,5Gb per each file.