Statistics' update at reaching the threshold

  • Hi Everyone!
    Have another question regarding the statistics update. Upon reaching the threshold of 20%+500 rows , does SQL server update all the statistics for that table , or it looks at this threshold for each stats objects and then updates as they qualify ? Thank you in advance.

    Arshad

  • Neither.

    When a query needs a statistic (for optimisation), the row modification count is checked. If it exceeds the threshold, then that statistic (and only that statistic) is updated.

    Gail Shaw
    Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
    SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability

    We walk in the dark places no others will enter
    We stand on the bridge and no one may pass
  • GilaMonster - Thursday, August 10, 2017 4:45 PM

    Neither.

    When a query needs a statistic (for optimisation), the row modification count is checked. If it exceeds the threshold, then that statistic (and only that statistic) is updated.

    Yeah I understand that the update initiation is propelled by the requirement of the optimization , and then the threshold is checked . Didn't know it'll be on only that stats object. Thanks for that. Where does SQL server get the row modification count ? I'm not expecting it to query the actual table to compare against the Histogram .Thanks.

    Arshad

  • Internal counters. Exposed in the DMV sys.dm_db_stats_properties

    Gail Shaw
    Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
    SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability

    We walk in the dark places no others will enter
    We stand on the bridge and no one may pass

Viewing 4 posts - 1 through 3 (of 3 total)

You must be logged in to reply to this topic. Login to reply