pg.ddx.io  pgsql-admin@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Alvaro Herrera <alvherre@alvh.no-ip.org>
To: Don Seiler <don@seiler.us>
Cc: Adrien Nayrat <adrien.nayrat@dalibo.com>
Cc: pgsql-admin <pgsql-admin@postgresql.org>
Subject: Re: No stats after promoting standby?
Date: Mon, 4 Dec 2017 19:02:31 -0300
Message-ID: <20171204220231.ywcqohbn47t5nha5@alvherre.pgsql> (raw)
In-Reply-To: <CAHJZqBC8eFDmdMcA70o1q_1-S_TKYz=wJ09OUg99qmYQEp61+g@mail.gmail.com>

Don Seiler wrote:
> On Mon, Dec 4, 2017 at 3:37 PM, Adrien Nayrat <adrien.nayrat@dalibo.com>
> wrote:
> >
> > Stats are deleted after promotion :
> > " The stats file is deleted at the start of recovery, so stats from
> > primary and
> > standby will differ; this is considered a feature, not a bug."
> > https://www.postgresql.org/docs/current/static/hot-standby.html

> OK good to know. Interesting point but I think I disagree about the standby
> having its own stats. Until replication is broken, wouldn't the data be
> identical to the primary, and so the statistics should be identical as well?

Those stats aren't part of regular data, so no they shouldn't.

The docs are telling half the truth when they say this is a
not-bug-but-feature, though.  It's true that we don't want to overwrite
some of these counters, such as number of scans, number of tuples
accessed, etc; but ideally we should keep things such as vacuum/analyze
counts and last times, and also the counts of dead/live/
mod_since_analyze tuples, to keep autovacuum informed without requiring
an ANALYZE.

This seems pretty difficult to implement, though; as far as I know we
haven't even discussed it.

-- 
Álvaro Herrera                https://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services




view thread (8+ messages)  latest in thread

Message-ID: <20171204220231.ywcqohbn47t5nha5@alvherre.pgsql>
Permalink:  ../20171204220231.ywcqohbn47t5nha5@alvherre.pgsql/
Also on:    postgresql.org/message-id/20171204220231.ywcqohbn47t5nha5@alvherre.pgsql

 · 

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-admin@postgresql.org
  Cc: alvherre@alvh.no-ip.org, don@seiler.us, adrien.nayrat@dalibo.com
  Subject: Re: No stats after promoting standby?
  In-Reply-To: <20171204220231.ywcqohbn47t5nha5@alvherre.pgsql>

* 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