Statistics updated with fullscan on primary replica are out of date on secondary - by ArianP

Status : 

  Fixed<br /><br />
		This item has been fixed in the current or upcoming version of this product.<br /><br />
		A more detailed explanation for the resolution of this particular item may have been provided in the comments section.

Sign in
to vote
ID 3109781 Comments
Status Resolved Workarounds
Type Bug Repros 0
Opened 10/30/2016 11:28:39 AM
Access Restriction Public


After updating a statistic on the primary with FULLSCAN, we have a query which runs on the secondary readonly replica with bad cardinality estimation and bad execution plan. 
The updated statistic is well replicated on the secondary, but curiously the modification counter is also strongly incremented (on the secondary only) and the new statistic is treated as out of date by the optimizer.
Creation of temporary statistic is triggered at the first query compiled, with the default sampling, which causes the cardinality estimation and plan issue.

The workaround is to disable auto update of statistics at the statistic, table or database level.
Sign in to post a comment.
Posted by Vikas Rana on 3/27/2017 at 3:01 AM
Fix for this issue released for SQL SERVER 2012, please check following KB article.

For SQL SERVER 2014 fix will be out in SP 2 CU 5 branch which is scheduled to release in April.