Re: autovacuum is running but pg_stat_all_tables empty

From: Laurenz Albe <laurenz(dot)albe(at)cybertec(dot)at>
To: Mariel Cherkassky <mariel(dot)cherkassky(at)gmail(dot)com>, pgsql-admin(at)lists(dot)postgresql(dot)org, pgsql-performance(at)lists(dot)postgresql(dot)org
Subject: Re: autovacuum is running but pg_stat_all_tables empty
Date: 2018-11-19 18:52:43
Message-ID: b669a66ef51af3416f422a180d0a3cb1903ea741.camel@cybertec.at
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-admin pgsql-performance

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

In response to

Browse pgsql-admin by date

  From Date Subject
Next Message Achilleas Mantzios 2018-11-19 19:03:49 Re: logging aql queries only one table or tables of one scheme
Previous Message Mariel Cherkassky 2018-11-19 17:31:35 autovacuum is running but pg_stat_all_tables empty

Browse pgsql-performance by date

  From Date Subject
Next Message Fabio Pardi 2018-11-20 13:11:23 Re: PostgreSQL VS MongoDB: a use case comparison
Previous Message Mariel Cherkassky 2018-11-19 17:31:35 autovacuum is running but pg_stat_all_tables empty