Database Scoped Configuration in SQL Server 2016

SQL Server 2016 will be really impressive. Since a few days ago Microsoft has made the RC0 version available for download. I have already done a quick tour through the RC0 version, and one of the nicest new features is the Database Scoped Configuration which I want to cover in today’s blog post.

Database Scoped Configuration

We all know that SQL Server has a lot of configuration options that can be only enabled globally at the SQL Server Instance level. Just think about the MAXDOP option (when you don’t use Resource Governor). Also Microsoft provided us with a huge number of different Trace Flags that change the internal behavior of SQL Server. Microsoft has now finally addressed these areas and SQL Server 2016 provides us with a lot of existing configuration options that we can configure at the database level without using any specific Trace Flags.

Database Scoped Configuration options in SQL Server 2016

Let’s have a more detailed look at them. With the Legacy Cardinality Estimation option you can control whether SQL Server uses the old or the new Cardinality Estimator that was introduced back in SQL Server 2014. It’s just a new configuration option that was previously controlled through the Trace Flags 2312 and 9481.

The option MAXDOP doesn’t need any explanation! Finally you are able to control the MAXDOP at the database level! This is really awesome! Especially for Sharepoint. Let’s see if a future version of Sharepoint will support the MAXDOP at the database level… Oh, and I’m already expecting to see a lot of databases with a MAXDOP of 1 at the database level to get rid of those nasty CXPACKET waits

The Parameter Sniffing option! Microsoft calls it a feature, I call it a bug. In general Parameter Sniffing is a good thing, because the Query Optimizer compiles a query plan for you based on the initially provided input values. That’s great, but the drawback is that the generated query plan is sensitive to the input parameters that were provided, and is only optimized for those provided input parameters. If you later reuse the cached query plan with different input parameter values it can be the case that your performance will suffer.

With this configuration option you can now control whether the Query Optimizer uses Parameter Sniffing or not. It’s a replacement for the Trace Flag 4136. If you disable Parameter Sniffing, SQL Server internally uses the same behavior as when you use the Query Hint OPTIMIZE FOR UNKNOWN – it will not give you a optimal performance, but will give you consistent performance

And finally you have the Query Optimizer Fixes configuration option. This configuration option enables and disables some specific Query Optimizer Fixes. It’s a replacement for Trace Flag 4199.

Summary

I *really* love the Database Scoped Configuration options! Especially the MAXDOP option. It would be a huge advantage for Sharepoint, if we could just run the Sharepoint specific databases with a MAXDOP of 1, and everything else with a better configured instance DOP.

What do you think about these new configuration options? Do you love them? Please feel free to leave a comment.

Thanks for your time,

-Klaus

5 thoughts on “Database Scoped Configuration in SQL Server 2016”

  1. Inspired by your statement “The Parameter Sniffing option! Microsoft calls it a feature, I call it a bug” I tried the 4136 trace flag in a system where we are struggling with “reuse of inefficient execution plans”.
    It looks like a success!

    1. Klaus Aschenbrenner

      Hello Erik,

      Thanks for your comment.
      It would be still interesting to know why the execution plans were inefficient 😉

      -Klaus

  2. Hallo Klaus,

    habe das mit MaxDop gerade bei einer Testinstallation gesehen, natürlich gleich mal danach gegoogled und bin dann bei dir auf der Seite gelandet 😉
    Hoffen wir mal dass die SharePoint Jungs das in Zukunft auch berücksichtigen werden 😛

    Gruß Michael

Leave a Reply to Erik T Nielsen Cancel Reply

Your email address will not be published. Required fields are marked *