Re: Vacuum Full Analyze Stalled

From: "Jim C(dot) Nasby" <jnasby(at)pervasive(dot)com>
To: Kevin Grittner <Kevin(dot)Grittner(at)wicourts(dot)gov>, tgl(at)sss(dot)pgh(dot)pa(dot)us, Jeff Kirby <Jeff(dot)Kirby(at)wicourts(dot)gov>, pgsql-admin(at)postgresql(dot)org
Subject: Re: Vacuum Full Analyze Stalled
Date: 2005-10-03 21:36:02
Message-ID: 20051003213602.GK40138@pervasive.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-admin pgsql-hackers

On Mon, Oct 03, 2005 at 04:12:25PM -0400, Alvaro Herrera wrote:
> On Mon, Oct 03, 2005 at 02:41:14PM -0500, Jim C. Nasby wrote:
> > I haven't looked in detail at autovacuum in 8.1 yet, but I know that in
> > previous versions it was a bad idea to depend on it to vacuum a small
> > table that has a lot of update activity frequently enough. The issue is
> > that since it's single-threaded if it starts a vacuum on a large table
> > it could be hours before it gets around to vacuuming the small table
> > again.
>
> Does it really make a lot of difference? While the big vacuum is
> running, old tuples accumulate on the small table, because it shows as a
> running transaction and the small vacuum won't delete them. The new
> autovacuum is no different than the old one in this regard. (There's a
> patch by Hannu Krossing IIRC that, if included in 8.2, will make things
> better.)

Hrm, http://archives.postgresql.org/pgsql-patches/2005-07/msg00086.php
indicates that multiple transactions are used during vacuum (see item
1). If that's the case, it is still better to run a stand-alone vacuum
if there are tables being autovacuumed that are large and have indexes.

In any case, Tom's got some serious objections to that patch, so it
might never make it in. I'd like to see an item on the TODO so this
doesn't slip through the cracks. It's also possible that a simpler,
cleaner version of this would be to have vacuum do it's work in batches
rather than messing around with visibility code (which I agree is
dangerous).
--
Jim C. Nasby, Sr. Engineering Consultant jnasby(at)pervasive(dot)com
Pervasive Software http://pervasive.com work: 512-231-6117
vcard: http://jim.nasby.net/pervasive.vcf cell: 512-569-9461

In response to

Browse pgsql-admin by date

  From Date Subject
Next Message Kevin Grittner 2005-10-03 21:37:17 Re: Vacuum Full Analyze Stalled
Previous Message Simon Riggs 2005-10-03 21:32:25 Re: Vacuum Full Analyze Stalled

Browse pgsql-hackers by date

  From Date Subject
Next Message Hannu Krosing 2005-10-03 21:43:10 Re: [HACKERS] A Better External Sort?
Previous Message Jeffrey W. Baker 2005-10-03 21:32:26 Re: [HACKERS] A Better External Sort?