Re: pg_stat_user_tables.n_mod_since_analyze persistence?

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Philip Semanchuk <philip(at)americanefficient(dot)com>
Cc: PostgreSQL General <pgsql-general(at)lists(dot)postgresql(dot)org>
Subject: Re: pg_stat_user_tables.n_mod_since_analyze persistence?
Date: 2021-02-15 20:55:10
Message-ID: 2274377.1613422510@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Philip Semanchuk <philip(at)americanefficient(dot)com> writes:
> I saw some unexpected behavior that I'm trying to understand. I suspect it might be a quirk specific to AWS Aurora and I'd like to confirm that.

> When I restart my local Postgres instance (on my Mac), the values in pg_stat_user_tables.n_mod_since_analyze are preserved. In other words, if table foo had n_mod_since_analyze=33 before the reboot, it still has n_mod_since_analyze=33 after the restart.

> When I restart an AWS Aurora instance, the values in pg_stat_user_tables.n_mod_since_analyze all seem to be reset to 0.

> Can anyone confirm (or refute) that the behavior I see on my Mac (preservation of these values through a restart) is common & expected behavior?

Yeah, in PG those stats would be preserved, at least as long as it's
a clean shutdown.

regards, tom lane

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Joe Abbate 2021-02-15 21:15:44 checkpointer and other server processes crashing
Previous Message Christophe Pettus 2021-02-15 20:40:54 Re: MultiXactMemberControlLock contention on a replica