pg.ddx.io  pgsql-admin@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Joe Conway <mail@joeconway.com>
To: Don Seiler <don@seiler.us>
Cc: pgsql-admin <pgsql-admin@postgresql.org>
Subject: Re: Why is my table not autovacuuming?
Date: Mon, 28 Aug 2017 09:44:15 -0700
Message-ID: <06d800f7-b1c7-91ab-0f1b-769f9a5860d1@joeconway.com> (raw)
In-Reply-To: <CAHJZqBDgTZMGcGOxx0f8T=VgqFVJMLon4--XNTT6N54LSLaHDg@mail.gmail.com>
References: <CAHJZqBAaXKi2+n4zNFYkjOCLY+ABpuC_BSMBKHfHfs0QqPNjbA@mail.gmail.com>
	<ea2474b3-82d8-3eb1-e781-a1ac54c7e11a@joeconway.com>
	<CAHJZqBDBYBoBRy1x-6-Y5NNcNaM6LKsjDD0bE8ewik3U+bev6g@mail.gmail.com>
	<f937001f-8848-f04e-b2a5-2cec58c340fc@joeconway.com>
	<CAHJZqBDgTZMGcGOxx0f8T=VgqFVJMLon4--XNTT6N54LSLaHDg@mail.gmail.com>
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-admin>

On 08/28/2017 09:31 AM, Don Seiler wrote:
> I think what I'm failing to understand is how it got so big without an
> autoanalyze kicking in at some point to keep relatively in sync. To my
> knowledge, autovacuum was never disabled here (I'm new, so I can't say
> with any certainty that it never was). I would expect as the inserted
> rows grow past a certain threshold, it would kick in an occasional
> analyze so it wouldn't get over 2 orders of magnitude off from 170K to 71M.

I can't say without knowing the history of this table and your server.

Autoanalyze with default settings should kick in at 0.1 (10%) of the
table changing. Lets say your table exists with 71 million rows. Then at
some point your server lost power. The info in the stats collector gets
reset on recovery. Now you modify 170k rows. That is now the change that
autoanalyze will base its decision on. It is looking for 0.1 x 70
million rows to change which is 7 million. You currently only have 170k
that have changed.

Bottom line is as I said earlier -- the default values for autovac and
autoanalyze scaling factor are ridiculously high for a table this large.
Do a manual VACUUM ANALYZE on it, and modify the settings for this table.

Joe

-- 
Crunchy Data - http://crunchydata.com
PostgreSQL Support for Secure Enterprises
Consulting, Training, & Open Source Development

Attachments:

  signature.asc (application/pgp-signature, 818B) download

view thread (14+ messages)  latest in thread

Message-ID: <06d800f7-b1c7-91ab-0f1b-769f9a5860d1@joeconway.com>
Permalink:  ../06d800f7-b1c7-91ab-0f1b-769f9a5860d1@joeconway.com/
Also on:    postgresql.org/message-id/06d800f7-b1c7-91ab-0f1b-769f9a5860d1@joeconway.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-admin@postgresql.org
  Cc: mail@joeconway.com, don@seiler.us
  Subject: Re: Why is my table not autovacuuming?
  In-Reply-To: <06d800f7-b1c7-91ab-0f1b-769f9a5860d1@joeconway.com>
  References: <CAHJZqBAaXKi2+n4zNFYkjOCLY+ABpuC_BSMBKHfHfs0QqPNjbA@mail.gmail.com> <ea2474b3-82d8-3eb1-e781-a1ac54c7e11a@joeconway.com> <CAHJZqBDBYBoBRy1x-6-Y5NNcNaM6LKsjDD0bE8ewik3U+bev6g@mail.gmail.com> <f937001f-8848-f04e-b2a5-2cec58c340fc@joeconway.com> <CAHJZqBDgTZMGcGOxx0f8T=VgqFVJMLon4--XNTT6N54LSLaHDg@mail.gmail.com> <06d800f7-b1c7-91ab-0f1b-769f9a5860d1@joeconway.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

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