Update Statistics

Chaitanya Kiran 776 Reputation points

If I update statistics on primary replica, does SQL Server replicate it to secondary replica?
Also, in Log shipping does it get replicated to secondary server?

SQL Server
SQL Server
A family of Microsoft relational database management and analysis systems for e-commerce, line-of-business, and data warehousing solutions.
13,336 questions
{count} votes

Accepted answer
  1. Seeya Xi-MSFT 16,461 Reputation points

    Hi @Chaitanya Kiran ,

    1. In SQL Server Always On Availability Group
      In SQL Availability groups, SQL Server creates and maintains statistics on primary replica databases. These SQL Server statistics from primary replica are sent to secondary replica similar to other transaction log records. If we are using the secondary replica for the reporting purpose and all the reports query fetching data from it, it might require different statistics from those statistics that are replicated from Primary replica.
      Please refer to this blog which contains a great test: SQL Server Statistics in Always On Availability Groups
    2. In Log Shipping
      Transaction logs contain a log of all the transactions(Update Statistics) happening in a SQL Server database.

    Best regards,

    If the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.

    1 person found this answer helpful.

1 additional answer

Sort by: Most helpful
  1. Dan Guzman 9,226 Reputation points

    Availability Groups and log shipping use the database transaction log as the source to apply changes to the target. The transaction log includes statistic updates so the target database will reflect the updated stats.

    1 person found this answer helpful.