Re: No stats after promoting standby?

From: Alvaro Herrera <alvherre(at)alvh(dot)no-ip(dot)org>
To: Don Seiler <don(at)seiler(dot)us>
Cc: Adrien Nayrat <adrien(dot)nayrat(at)dalibo(dot)com>, pgsql-admin <pgsql-admin(at)postgresql(dot)org>
Subject: Re: No stats after promoting standby?
Date: 2017-12-04 22:02:31
Message-ID: 20171204220231.ywcqohbn47t5nha5@alvherre.pgsql
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-admin

Don Seiler wrote:
> On Mon, Dec 4, 2017 at 3:37 PM, Adrien Nayrat <adrien(dot)nayrat(at)dalibo(dot)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

In response to

Responses

Browse pgsql-admin by date

  From Date Subject
Next Message Don Seiler 2017-12-04 22:11:23 Re: No stats after promoting standby?
Previous Message Don Seiler 2017-12-04 21:54:00 Re: Former Standby Wants to Archive Old WAL files?