From: Jim C. Nasby <jnasby@pervasive.com>
To: Robin Iddon <robin@edesix.com>
Cc: Tom Lane <tgl@sss.pgh.pa.us>
Cc: pgsql-admin@postgresql.org
Subject: Re: 8.0.3 pg_autovacuum doesn't clear out stats table?
Date: Thu, 23 Feb 2006 17:44:12 -0600
Message-ID: <20060223234412.GM2068@pervasive.com> (raw)
In-Reply-To: <43FE467E.9090204@edesix.com>
References: <43FD7312.5080701@edesix.com>
<43FDF046.2050609@zeut.net>
<43FDFF9A.90603@edesix.com>
<43FE0723.3070608@edesix.com>
<26139.1140730764@sss.pgh.pa.us>
<43FE467E.9090204@edesix.com>
On Thu, Feb 23, 2006 at 11:34:22PM +0000, Robin Iddon wrote:
> From that I see that the pg_statistics table is never inserted/deleted
> only updated (ins/del counts are 0), and in principle simply analyzing
> doesn't increase the tuple count.
Sure it does. An update in PostgreSQL is essentially identical to a
DELETE followed by an INSERT, due to MVCC.
> I wonder if Matt's suggestion on the vacuum scale is not in fact the
> real issue here. Because my scale is set to 2 (the default) but the
> number of inserts is always zero (unless we create new tables/indexes, I
> think the number of active stats stays the same, no?) and the number of
> updates is at most equal to the number of tuples, we can never get
> enough changes to trigger a vacuum (which would require 2x the number of
> updates). Now any removable rows won't ever get removed.
Sure it well, unless pg_autovacuum can't stay running long enough.
> In fact I just noticed that the number of stats tuples just climbed from
> 1236 to 2634. The ins/del counts are still zero. I ran analyze and the
> update counter went up only by 1232. For pg_autovacuum to vacuum this
> table I need (2*2634)+1000 = 6268 updates, which is never going to happen.
Uh, just run analyze 6 times; that should be enough to cause autovacuum
to kick in.
> So I'm going to run with a fractional value of scale for a while and see
> if it makes things any better.
Definately a good idea in any case. You might also consider going to
8.1.3; you'd get built-in autovac which means one less thing to manage,
plus it's default settings are a lot saner (though still too high IMHO).
--
Jim C. Nasby, Sr. Engineering Consultant jnasby@pervasive.com
Pervasive Software http://pervasive.com work: 512-231-6117
vcard: http://jim.nasby.net/pervasive.vcf cell: 512-569-9461
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: jnasby@pervasive.com, robin@edesix.com, tgl@sss.pgh.pa.us
Subject: Re: 8.0.3 pg_autovacuum doesn't clear out stats table?
In-Reply-To: <20060223234412.GM2068@pervasive.com>
References: <43FD7312.5080701@edesix.com> <43FDF046.2050609@zeut.net> <43FDFF9A.90603@edesix.com> <43FE0723.3070608@edesix.com> <26139.1140730764@sss.pgh.pa.us> <43FE467E.9090204@edesix.com> <20060223234412.GM2068@pervasive.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