pg.ddx.io  pgsql-performance@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Vik Fearing <vik.fearing@2ndquadrant.com>
To: Joao Junior <jcoj2006@gmail.com>
To: pgsql-performance@postgresql.org
Cc: Pavel Stehule <pavel.stehule@gmail.com>
Subject: Re: Analyze on slave promoted.
Date: Fri, 27 Sep 2019 12:41:05 +0200
Message-ID: <ba1c2d91-d1af-f704-7374-5f2ec771db38@2ndquadrant.com> (raw)
In-Reply-To: <CABnPa_j1oLm_psF3f8o5GZBoh+2acWkkARH1d6dFKQyL5Bt+tw@mail.gmail.com>
References: <CABnPa_j1oLm_psF3f8o5GZBoh+2acWkkARH1d6dFKQyL5Bt+tw@mail.gmail.com>

On 26/09/2019 09:54, Joao Junior wrote:
> Hi,
> Is this necessary to run analyze on a slave using streaming
> replication  after promotion??
>

Yes, you should run ANALYZE on all of your tables in all of your
databases after a promotion.  The data distribution statistics are
replicated, as Pavel mentioned, but other statistics are not.  In
particular, pg_stat_all_tables.n_dead_tup is not replicated and so
autovacuum has no idea when it needs to run.






view thread (3+ messages)

Message-ID: <ba1c2d91-d1af-f704-7374-5f2ec771db38@2ndquadrant.com>
Permalink:  ../ba1c2d91-d1af-f704-7374-5f2ec771db38@2ndquadrant.com/
Also on:    postgresql.org/message-id/ba1c2d91-d1af-f704-7374-5f2ec771db38@2ndquadrant.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-performance@postgresql.org
  Cc: vik.fearing@2ndquadrant.com, jcoj2006@gmail.com, pavel.stehule@gmail.com
  Subject: Re: Analyze on slave promoted.
  In-Reply-To: <ba1c2d91-d1af-f704-7374-5f2ec771db38@2ndquadrant.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox