Workarounds for Updating Stats on Secondaries

Niko Neugebauer wants statistics updates on tables running on readable Availability Group secondary nodes:

Let’s list the basic known details for the possible solution(for the Enterprise Edition of the Sql Server that is):
– We can make the secondary replica readable and read the same data on it. (Not that you should do that by default, but if you really know what you are doing …)
– We can copy our object into the TempDB (yeah, your Multi-TB table is probably not the best candidate for this operation), or maybe into some other writable DB.
– We can write results in the shared folder between the replicas (let’s say in a text file into a File Share)
– We can export the BLOB object of the statistics out of the SQL Server
– We can import the BLOB object of the statistics into the statistics

Read the whole thing.

Related Posts

The Costs of Bad Statistics

Monica Rathbun explains what happens when statistics go wrong: Over Estimations of Rows (Actual > Estimated) leads to: – Selection of parallel plan when a serial plan might be more optimal– Inappropriate join strategy selections– Inefficient Index Navigation (scan verses seek)– Inflated Memory Grants Read the whole thing. The optimizer doesn’t get to look at […]

Read More

AG Support for Containers: Not RTM

Allan Hirt makes a disappointing discovery: This one is going to be a short post. One of the big capabilities of SQL Server 2019 – the ability to deploy AGs using containers – is not shipping when SQL Server 2019 is released. Read the whole thing, which isn’t much longer than my snippet. But Allan […]

Read More

Categories

June 2019
MTWTFSS
« May Jul »
 12
3456789
10111213141516
17181920212223
24252627282930