Quantcast
Channel: SQL Server High Availability and Disaster Recovery forum
Viewing all articles
Browse latest Browse all 4532

is it expected this behaviour with stats on Always ON?

$
0
0

Hi guys,

Primary platform is Sql2k14 SP2

Imagine the following situation:

The stats for a column in a table are out of sync in the secondary replica so when you execute some query gets a message like that:

Could not locate statistics '_WA_Sys_0000001F_200E7F64' in the system catalogs.
DBCC execution completed. If DBCC printed error messages, contact your system administrator.


You identifies _WA_Sys_0000001F_200E7F64 in sys.stats table and is it about, let's say"TABLEA"


select object_name(object_id),* from sys.stats
where [name] = '_WA_Sys_0000001F_200E7F64';

You compare both stats _WA_Sys_0000001F_200E7F64 in both replicas (writeable and readable)
and in the readable you see "Statistics for these columns were last updated (NEVER)". In the writeable is updated


After that you execute a REBUILD ALL against all the indexes on writeable replica.

Second later you can run the query without issues.

I am stuck with that. Let me explain:

I don't understand the relation between Indexes and Stats objects created for columns when none of my indexes inTABLEA were using the column affected by the object
stats _WA_Sys_0000001F_200E7F64

How can I refresh only the stats you want without rebuilding all the indexes?

What am I missing here?

Thanks for your explanations,

Enric


Viewing all articles
Browse latest Browse all 4532

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>