File writes are distributed across files in the same file group proportionally based on the current size of each file in the file group. This is referred to as the "proportional fill algorithm" - look at http://sqlserver-performance-tuning.net/?p=2552 for some interesting details around that.
tempdb
can have only a single filegroup. If you attempt to create a filegroup in tempdb
you get the following:
Msg 1826, Level 16, State 1, Line 1
User-defined filegroups are not allowed on "tempdb".
If you have trace flag 1117 turned on, files within a group will autogrow simultaneously across files in the filegroup for each file that is not currently at its maximum size, and where space exists on the disk.
Does your instance have trace flag 1117 turned on? You'd probably want it off in this particular instance even though "best practices" often indicate having this turned on. There is an item on Microsoft Connect asking to have a setting like this that can be enabled/disabled on a per-database basis, here: https://connect.microsoft.com/SQLServer/feedback/details/781198/trace-flag-1117-autogrowth-of-data-files-is-instance-wide-would-like-a-flag-for-just-tempdb
Assuming the SSDs are devoted to tempdb, I agree with your assertion and suggest making the tempdb on the SSDs as big as possible (not 100% of the drive, perhaps leave 10% free). Make the tempdb files on disk as small as possible, say 1MB, with autogrowth, and maximum file size as big as you need. Monitor for tempdb filegrowth on the HDDs, and make the case for getting bigger SSDs if you think the company would benefit from it.
According to the documentation, SQL Server files can be created on raw partitions (partitions that haven't been formatted) by using just the drive letter of the partition in the ALTER DATABASE ... ADD FILE
syntax. This apparently removes the need to grow or shrink the file since it inherently uses the entire raw partition, as needed. I'm uncertain if this would help your situation or not; just thought I'd throw it out there as an interesting factoid. See "If the file is on a raw partition, os_file_name must specify only the drive letter of an existing raw partition. Only one file can be put on each raw partition."
Following what @Damien_The_Unbeliever commented, yes those are Table variables
only and if you are still observing them then it's evident that from whichever procedure those got created is still opened (or) not completed yet else those would have already been cleared from TempDB
. To do a test try the code snippet and check against System Databases > tempdb > Temporary Tables:
you will see that the table variable is exist.
declare @tab table(col1 int);
waitfor delay '8:10';
insert into @tab values(123);
Once you cancel the query, it gets cleared from TempDB.
Best Answer
You should grow the initial size of
tempdb
so that those large temp tables no longer cause auto-growth, since it sounds like that is your normal load. This way you reserve the disk space that is required by your application. You do not want to run into the nasty surprise that temdb cannot grow and causes failures in your app. See Capacity Planning for tempdb and Optimizing tempdb Performance: