Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
 
Log in  ::  Register  ::  Not logged in
 
 
 
        
Home       Members    Calendar    Who's On


Add to briefcase

Update Statistics Expand / Collapse
Author
Message
Posted Sunday, September 9, 2012 12:39 AM
SSC-Enthusiastic

SSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-Enthusiastic

Group: General Forum Members
Last Login: Saturday, September 27, 2014 3:29 AM
Points: 108, Visits: 1,098
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??
Post #1356451
Posted Monday, September 10, 2012 8:45 AM


SSCarpal Tunnel

SSCarpal TunnelSSCarpal TunnelSSCarpal TunnelSSCarpal TunnelSSCarpal TunnelSSCarpal TunnelSSCarpal TunnelSSCarpal TunnelSSCarpal Tunnel

Group: General Forum Members
Last Login: Yesterday @ 4:21 PM
Points: 4,394, Visits: 6,250
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 at GMail
Post #1356791
« Prev Topic | Next Topic »

Add to briefcase

Permissions Expand / Collapse