SQL Clone
SQLServerCentral is supported by Redgate
Log in  ::  Register  ::  Not logged in

TEMPDB Enhancements in SQL Server 2016

By Dharmendra Keshari, (first published: 2016/04/13)

SQL Server 2016 is loaded with a lot of new enhancements and features. One of them is the default tempdb configuration chosen during setup. A properly configured tempdb database is often critical for better throughput for SQL Server applications.

When we install SQL Server 2016, the installation setup wizard does not create a single data file by default. Instead, it creates a default number of files based on the number of logical processors that setup detects on your machine, up to a maximum of 8 tempdb data files. This helps reduce contention on PFS, GAM and SGAM pages. To understand more about PFS, GAM and SGAM pages I recommend “Inside the Storage Engine: GAM, SGAM, PFS and other allocation maps”. Creating multiple data files is a great place to start, however you still need to make sure that tempdb is sized properly for your workload to avoid tempdb having to regrow each time the SQL Server service is restarted.

I have 4 core machine, and the tempdb installation tab, by default, detected four processors and configures four files, as you see in the following image:

Out of the Box Enhancements in tempdb

Before SQL Server 2016, it was recommended that users enable trace flags 1117 and 1118 for applications that have heavy tempdb utilization. The benefits for enabling the trace flags are:

  • Trace Flag 1118 reduces Shared Global Allocation Map (SGAM) contention.
  • Trace Flag 1117 strictly forces all data files within the filegroup to grow at the same time.

A few reference links – 2012 & 2014, 2008, 2005.

With SQL Server 2016, the functionality of trace flags 1117 and 1118 have been enabled by default for tempdb, avoiding the need to enable them manually.

Trace Flag 1118 – The below screen shot shows that the is_mixed_page_allocation_on value is 0 for only tempdb. This means the trace flag 1118 is enabled. This occurs by default.

Here is the definition of the value.

Control Switch (





Tables and indexes in the database always allocate initial pages from uniform extents.



Tables and indexes in the database can allocate initial pages from mixed extents.


Trace Flag 1117 – The below screen shot shows that the is_autogrow_all_files value is 1 for only tempdb. This indicates that it is the only system database that supports Autogrow_All_Files ON option.


These out-of-the-box enhancements for tempdb in SQL Server 2016 reduces tempdb contention issues by default by having multiple tempdb data files. This helps reduce contention on the PFS, GAM and SGAM pages. Don't forget to make sure that you size your data files to your workload, as that is not done automatically. Trace flags 1118 and 1117 were available in versions prior to SQL Server 2016, however, you had to manually enable them. With SQL Server 2016, this benefit is available for tempdb out of the box. The user experience for tempdb should be drastically improved for users of SQL Server 2016.

Total article views: 5899 | Views in the last 30 days: 1122
Related Articles

Stairway to Server-side Tracing - Level 4: How to Create and View Default and black box Trace Data

An introduction to the SQL Server default and black box traces targeted at DBAs who are new to these...


Identify Allocation Contention in TEMPDB

Identifies potential page allocation contention in TEMPDB.


SQL Server Default Trace

The default trace in SQL Server is something I have been experimenting with lately. It is a feature ...


Default trace - A Beginner's Guide

This article is the beginner's guide to Default Trace. The article outlines how to query the defaul...


Determining Default Trace Location

While working on some scripts against SQL Server’s default trace, I wanted to develop a sure fire wa...