8 responses

  1. Alex
    November 1, 2021

    Thanks Paul, that new wait type will be useful.

    Reply

  2. Bojan Jekic
    November 1, 2021

    If I don't have problem with AUTO UPDATE STATISTICS – I will not change default configuration. That should be rule for everything. Generally, I am sure that all changes/issues/bugs on SQL engine are more and better tested (in Microsoft) in combination with default values of other configurations, and because of relation between functionalities and configurations I will keep default values if they work well.
    But, we change AUTO_UPDATE_STATISTICS_ASYNC to ON (to non default value), on our huge OLTP database, and we do that (a few years ago) because one specific issue immediately after migration on SQL Server 2016, because of unexpected behavior:
    During procedure recompilation, when Engine decided to update statistic during compilation time (synchronous, before query execution), although we maintain statistics on three days, in that specific situation it lasted too long. It couldn't to finish that update stats in 30 seconds, and all requests went to timeout before query execution starts. It was very complicate situation and this is not place to write about details, but we didn't have a problem before with the same procedure on SQL Server 2014. That configuration change wasn't solution, that was a workaround.
    I have a big question? And I didn't get an answer from Microsoft, after 6 months of correspondence. If engine during compile time finds out-of-dated statistic (AUTO_UPDATE_STATISTICS_ASYNC is OFF), why there are no mechanism that engine refuse that update if concludes it will take too long? For me, on OLTP system, everything longer than few seconds for update stats during compilation time is unacceptable.

    Before migration we didn't have that problem

    Reply

  3. Paul Randal
    November 1, 2021

    That's just the way it works – what should be the value for 'too long'? And that would require knowing buffer pool contents – what proportion of the required data file pages are already in memory. Hence the 'sledgehammer' approach of turning auto-update off or using async updates.

    Reply

  4. John Cas
    November 3, 2021

    Many thanks for the blog! Always good to read a refresher.

    Not sure if this is still the case, but it certianly appead to be an issue we had a while back for async:

    Does the Async Statistic update work if the query that generates the request for the update fails?

    Reply

    • Paul Randal
      November 3, 2021

      If query compilation gets as far as noticing the need for the async stats update and adding it to the background task queue, it will happen regardless of how much further compilation and execution proceeds.

      Reply

  5. Clement
    February 22, 2024

    We've also encountered timeouts due to statistics update. It's been very difficult to get to the source of the issue.

    Thanks for the tip with the command contains STATMAN. Very useful!

    For some reason, when we look at sys.dm_os_wait_stats , what we see is a wait type of "WAIT_ON_SYNC_STATISTICS_REFRESH" instead of "WAIT_ON_SYNCHRONOUS_STATISTICS_UPDATE". That sounds like the same thing. Was the name updated at some point?

    Reply

  6. Paul Randal
    June 9, 2026

    My guess is the name was updated – and you're very welcome!

    Reply

  7. Gavan Stockdale
    June 23, 2026

    Paul Randal – thanks for coming back on this one!

    Reply

Leave a Reply

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

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Back to top