pg_stat_all_tables: n_live_tup column value not persisting - Mailing list pgsql-general

From pran d
Subject pg_stat_all_tables: n_live_tup column value not persisting
Date
Msg-id CA+rMFZs4izZ+NauB8+2Uz01uBTdD2SRXawVpcTQrybM3LONNuA@mail.gmail.com
Whole thread Raw
List pgsql-general
Hi,
I'm trying to get the row count of each table in a database, for which I'm using the postgres  statistics table:pg_stat_all_tables.
To determine the count Im using n_live_tup column in pg_stat_all_tables.

 I manually ran vacuum and analyse on the database so the latest counts get updated in pg_stat_all_tables. The issue is that after 3-4 days, I observed that the n_live_tup values for all the tables became zero in pg_stat_all_tables. I'm unable to understand why they became zero.
I did not  make any DML changes nor did I  run the pg_stat_reset function.

Pg Version: 12
OS:Linux 5.10







Thanks,
Pranavi




pgsql-general by date:

Previous
From: qihua wu
Date:
Subject: Re: synchronized standby: committed local and waiting for remote ack
Next
From: Alban Hertroys
Date:
Subject: Re: Are ZFS snapshots unsafe when PGSQL is spreading through multiple zpools?