pg.ddx.io  pgsql-admin@postgresql.org mailing list archive  
help / color / mirror / Atom feed
autovacuum is running but pg_stat_all_tables empty
2+ messages / 2 participants
[nested] [flat]

* autovacuum is running but pg_stat_all_tables empty
@ 2018-11-19 17:31  Mariel Cherkassky <mariel.cherkassky@gmail.com>
  0 siblings, 1 reply; 2+ messages in thread

From: Mariel Cherkassky @ 2018-11-19 17:31 UTC (permalink / raw)
  To: pgsql-admin@lists.postgresql.org; pgsql-performance@lists.postgresql.org

Hi,
I'm trying to understand something that is weird on one of my environments.
When I query pg_stat_all_tables I see that most of the tables dont have any
value in the last_autovacuum/analyze column. In addition the columns
autovacuum_count/analyze_count is set to 0. However, when checking the
logs, I see that on some of those tables autovacuum run. I think that there
is something wrong with the database statistics collector. In addition, the
column n_dead_tup and n_live_tup are set and in some of the cases
n_dead_tup is more then 20% of the table tuples. In addition, all tables
have default vacuum threshold.

Any idea what else I can check ?
The problem isnt only that dead tuples arent deleted (I dont have long
running transaction that might cause it) but the fact that the statistics
arent accurate/wrong.

^ permalink  raw  reply  [nested|flat] 2+ messages in thread

* Re: autovacuum is running but pg_stat_all_tables empty
@ 2018-11-19 18:52  Laurenz Albe <laurenz.albe@cybertec.at>
  parent: Mariel Cherkassky <mariel.cherkassky@gmail.com>
  0 siblings, 0 replies; 2+ messages in thread

From: Laurenz Albe @ 2018-11-19 18:52 UTC (permalink / raw)
  To: Mariel Cherkassky <mariel.cherkassky@gmail.com>; pgsql-admin@lists.postgresql.org; pgsql-performance@lists.postgresql.org

Mariel Cherkassky wrote:
> I'm trying to understand something that is weird on one of my environments.
> When I query pg_stat_all_tables I see that most of the tables dont have any
> value in the last_autovacuum/analyze column. In addition the columns
> autovacuum_count/analyze_count is set to 0. However, when checking the logs,
> I see that on some of those tables autovacuum run. I think that there is
> something wrong with the database statistics collector. In addition, the
> column n_dead_tup and n_live_tup are set and in some of the cases n_dead_tup
> is more then 20% of the table tuples. In addition, all tables have default
> vacuum threshold.
> 
> Any idea what else I can check ?
> The problem isnt only that dead tuples arent deleted (I dont have long running
> transaction that might cause it) but the fact that the statistics arent accurate/wrong.

You can use the "pgstattuple" extension to check that table for the actual
dead tuple percentage to see if the statistics are accurate or not.

To see the statistic collector's UDP socket, run

    netstat -a|grep udp|grep ESTABLISHED

Check if it is there.  If it is on IPv6, make sure that IPv6 is up, otherwise
that would explain why you have no accurate statistics.

Are there any log messages about statistics collection?

Yours,
Laurenz Albe
-- 
Cybertec | https://www.cybertec-postgresql.com





^ permalink  raw  reply  [nested|flat] 2+ messages in thread


end of thread, other threads:[~2018-11-19 18:52 UTC | newest]

Thread overview: 2+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2018-11-19 17:31 autovacuum is running but pg_stat_all_tables empty Mariel Cherkassky <mariel.cherkassky@gmail.com>
2018-11-19 18:52 ` Laurenz Albe <laurenz.albe@cybertec.at>

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox