Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1gOofK-0006Bc-6x for pgsql-admin@arkaria.postgresql.org; Mon, 19 Nov 2018 18:52:58 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1gOofH-0002z2-Oc for pgsql-admin@arkaria.postgresql.org; Mon, 19 Nov 2018 18:52:55 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1gOofH-0002yr-H3; Mon, 19 Nov 2018 18:52:55 +0000 Received: from mx1.mailbox.org ([2001:67c:2050:104:0:1:25:1]) by magus.postgresql.org with esmtps (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1gOofE-0002GT-QM; Mon, 19 Nov 2018 18:52:54 +0000 Received: from smtp2.mailbox.org (smtp2.mailbox.org [80.241.60.241]) (using TLSv1.2 with cipher ECDHE-RSA-CHACHA20-POLY1305 (256/256 bits)) (No client certificate requested) by mx1.mailbox.org (Postfix) with ESMTPS id 86DA642921; Mon, 19 Nov 2018 19:52:48 +0100 (CET) X-Virus-Scanned: amavisd-new at heinlein-support.de Received: from smtp2.mailbox.org ([80.241.60.241]) by spamfilter04.heinlein-hosting.de (spamfilter04.heinlein-hosting.de [80.241.56.122]) (amavisd-new, port 10030) with ESMTP id uTzIy8H1Ss4L; Mon, 19 Nov 2018 19:52:46 +0100 (CET) Message-ID: Subject: Re: autovacuum is running but pg_stat_all_tables empty From: Laurenz Albe To: Mariel Cherkassky , pgsql-admin@lists.postgresql.org, pgsql-performance@lists.postgresql.org Date: Mon, 19 Nov 2018 19:52:43 +0100 In-Reply-To: References: Organization: Cybertec Content-Type: text/plain; charset="UTF-8" Mime-Version: 1.0 Content-Transfer-Encoding: 7bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk 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