Re: No stats after promoting standby? - Mailing list pgsql-admin

From Alvaro Herrera
Subject Re: No stats after promoting standby?
Date
Msg-id 20171204220231.ywcqohbn47t5nha5@alvherre.pgsql
Whole thread Raw
In response to Re: No stats after promoting standby?  (Don Seiler <don@seiler.us>)
Responses Re: No stats after promoting standby?  (Don Seiler <don@seiler.us>)
List pgsql-admin
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


pgsql-admin by date:

Previous
From: Don Seiler
Date:
Subject: Re: Former Standby Wants to Archive Old WAL files?
Next
From: Don Seiler
Date:
Subject: Re: No stats after promoting standby?