Blog

  • Setting the Sample Rate for Automatic Statistics updates

    I talked a few posts ago about Automatic Sample Sizes for Statistics Updates. From SQL 2016 CU4 we’ve been able to override that. You can manually update a statistics object specifying a given sample rate, and specify that that sample rate is what will be used for any subsequent automatic updates on the same object. Read more

  • Viewing the Statistics Objects Used to Create an Execution Plan

    Use trace flag 8666 to view the statistics objects that the optimizer used to generate your execution plan. Read more

  • Automatic Sample Sizes for Statistics Updates

    Looking at how SQL Server samples your data when doing auto-stats updates. Part of a series on understanding statistics, to help you achieve optimal performance of your queries on SQL Server. Read more

  • Manually updating Statistics

    Having up to date statistics is vital for getting the best performance out of your queries. Even though SQL Server automatically updates statistics in the background for you, you may find there are times when you want to manage updating them yourself. Read more

  • Book Review: Learn dbatools in a Month of Lunches

    If you work in the world of SQL Server you’ve almost certainly heard of dbatools. For those who haven’t, it’s an open source PowerShell module for automating literally hundreds of tasks on your database instances. What the rest of you may or may not know, is that the creators of dbatools have been working on… Read more

  • Statistics and the Ascending Key Problem

    I’ve mentioned previously how not having up to date statistics can cause problems in query performance. This post looks at something called the Ascending Key Problem which can badly affect your cardinality estimation in some cases and therefore your execution plans. The Ascending Key Problem relates to the most recently inserted data in your table… Read more