pg_stat_all_tables: n_live_tup column value not persisting

From: pran d <dpran433(at)gmail(dot)com>
To: pgsql-general(at)lists(dot)postgresql(dot)org
Subject: pg_stat_all_tables: n_live_tup column value not persisting
Date: 2023-01-17 06:15:57
Message-ID: CA+rMFZs4izZ+NauB8+2Uz01uBTdD2SRXawVpcTQrybM3LONNuA@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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

Browse pgsql-general by date

  From Date Subject
Next Message Alban Hertroys 2023-01-17 08:05:00 Re: Are ZFS snapshots unsafe when PGSQL is spreading through multiple zpools?
Previous Message qihua wu 2023-01-17 03:06:44 Re: synchronized standby: committed local and waiting for remote ack