Received: from localhost (unknown [200.46.204.183]) by mail.postgresql.org (Postfix) with ESMTP id C0F3664FEB3 for ; Wed, 17 Dec 2008 15:36:03 -0400 (AST) Received: from mail.postgresql.org ([200.46.204.86]) by localhost (mx1.hub.org [200.46.204.183]) (amavisd-maia, port 10024) with ESMTP id 41617-01 for ; Wed, 17 Dec 2008 15:36:01 -0400 (AST) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from outbound.afilias.info (outbound.afilias.info [69.46.124.26]) by mail.postgresql.org (Postfix) with ESMTP id 3794664FCBD for ; Wed, 17 Dec 2008 15:36:01 -0400 (AST) Received: from bmp-336-ms506.wa.yyz2.afilias-ops.info ([10.50.129.112] helo=smtp.afilias.info) by outbound.afilias.info with esmtp (Exim 4.69) (envelope-from ) id 1LD2BO-00036y-5J; Wed, 17 Dec 2008 19:35:46 +0000 Received: from vgateway.libertyrms.info ([207.219.45.62] helo=[10.1.3.44]) by smtp.afilias.info with esmtpsa (SSLv3:AES256-SHA:256) (Exim 4.69) (envelope-from ) id 1LD2BK-00043R-8J; Wed, 17 Dec 2008 19:35:42 +0000 Subject: Re: controlling autovacuum during the day. From: Brad Nicholson To: Alvaro Herrera Cc: Michael Fuhr , Tom Lane , John Lister , pgsql-admin@postgresql.org In-Reply-To: <20081217163130.GF4453@alvh.no-ip.org> References: <2BB7361E57C4417A975C0474610BA4C3@squarepi.com> <27759.1229521625@sss.pgh.pa.us> <742A9D77A1BA4171AF52BBBF6F5F2C75@squarepi.com> <28510.1229525243@sss.pgh.pa.us> <20081217152903.GA37436@winnie.fuhr.org> <20081217163130.GF4453@alvh.no-ip.org> Content-Type: text/plain; charset=utf-8 Date: Wed, 17 Dec 2008 14:35:51 -0500 Message-Id: <1229542551.6302.13.camel@bnicholson-desktop> Mime-Version: 1.0 X-Mailer: Evolution 2.22.3.1 Content-Transfer-Encoding: quoted-printable X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200812/133 X-Sequence-Number: 30966 On Wed, 2008-12-17 at 13:31 -0300, Alvaro Herrera wrote: > Michael Fuhr wrote: > > On Wed, Dec 17, 2008 at 09:47:23AM -0500, Tom Lane wrote: > > > "John Lister" writes: > > > > Cheers for the quick reply. I've tweaked them quite a bit, but we h= ave quite=20 > > > > a few heavily updated tables that i'd like vacuuming to keep them i= n check.=20 > > > > Unfortunately the autovacuum does a FULL vacuum every so often lock= ing the=20 > > > > tables for quite a long time, i'd like to move these to the evening= if=20 > > > > possible. > > >=20 > > > Huh? Autovacuum *never* does VACUUM FULL. > >=20 > > Perhaps autovacuum is shrinking the table after finding lots of empty > > pages at the end, as in what VACUUM VERBOSE is logging here: > >=20 > > INFO: "foo": truncated 11944384 to 8877366 pages > >=20 > > I think this acquires an AccessExclusiveLock. I've seen this take > > hours in the case of a table with a lot of empty pages. >=20 > There was a bug in earlier versions which caused lazy vacuum to do > cost-based delays during this phase, which caused the lock to be held > for ridiculous lengths of time. This was fixed in 8.2.something; it > shouldn't sleep anymore, but it does need to scan those pages in order > to truncate, so it can still take a while. Does this mean that if you are using autovac on 8.1, you should not use the cost delay feature? --=20 =EF=BB=BFBrad Nicholson 416-673-4106 Database Administrator, Afilias Canada Corp.