Update Statistics

  • Hi every body

    Updating statistics causes queries to recompile.

    first time that i run a query with a parameter,the query optimizer make a plan according to that parameter and the next time it doesnt make another plan for another parameter but it uses the first plan which may be not optimal for that parameter and it causes reduction in performance.(parameter sniffing)

    when i run update statistics it takes 30 minutes to compelete.

    what happens in this 30 minutes?i mean if i run a query during the updating,it recompiles or the query optimizer use the first plan until it finishes updating then after that it start recompliling?

    during this 30 minutes which plan is used??

  • My understanding is that stats are not "swapped out" until they are complete - at which point stuff is marked as recompile. So your existing plan will keep getting reused in the 30 mins it takes to complete stats update on the table/index/stat that affects the plan.

    Best,
    Kevin G. Boles
    SQL Server Consultant
    SQL MVP 2007-2012
    TheSQLGuru on googles mail service

Viewing 2 posts - 1 through 1 (of 1 total)

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