X-Original-To: pgsql-performance-postgresql.org@localhost.postgresql.org Received: from localhost (av.hub.org [200.46.204.144]) by postgresql.org (Postfix) with ESMTP id C4DDC9DC883 for ; Tue, 14 Mar 2006 17:13:57 -0400 (AST) Received: from postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 24251-02 for ; Tue, 14 Mar 2006 17:13:58 -0400 (AST) X-Greylist: from auto-whitelisted by SQLgrey- Received: from noel.decibel.org (noel.decibel.org [67.100.216.10]) by postgresql.org (Postfix) with ESMTP id 8DECC9DC80A for ; Tue, 14 Mar 2006 17:13:54 -0400 (AST) Received: by noel.decibel.org (Postfix, from userid 1001) id 92B7256431; Tue, 14 Mar 2006 15:13:56 -0600 (CST) Received: (hashcash-sendmail, from uid 1001); Tue, 14 Mar 2006 15:13:56 -0600 Date: Tue, 14 Mar 2006 15:13:56 -0600 From: "Jim C. Nasby" To: Pallav Kalva Cc: pgsql-performance@postgresql.org Subject: Re: Vacuum template databases, Urgent: Production problem Message-ID: <20060314211355.GV45250@pervasive.com> References: <4416F2DC.4010400@livedatagroup.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <4416F2DC.4010400@livedatagroup.com> X-Operating-System: FreeBSD 6.0-RELEASE-p4 amd64 X-Distributed: Join the Effort! http://www.distributed.net User-Agent: Mutt/1.5.11 X-Hashcash: 1:20:060314:pkalva@livedatagroup.com::N05x7gdA3IZeZMkg:0000000000000 0000000000000000000000001WkH X-Hashcash: 1:20:060314:pgsql-performance@postgresql.org::Yb3vOpQO4Ipnhk6p:00000 0000000000000000000000003f5O X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, score=0.109 required=5 tests=[AWL=0.109] X-Spam-Score: 0.109 X-Spam-Level: X-Archive-Number: 200603/199 X-Sequence-Number: 17636 On Tue, Mar 14, 2006 at 11:44:12AM -0500, Pallav Kalva wrote: > Hi, > > Do we have to vacuum template0 database regularly ? We got this warning > this morning while vacuuming databases. As a part of my daily vacuum job > I do vacuum of quartz, helix_fdc and affiliate databases which are the > one's which are heavily updated and used. But today I realized that usps, > template1 and template0 is also being used in a transaction somehow based > on this (SELECT datname, age(datfrozenxid) FROM pg_database;) query. > Actually we dont do any updates on usps , template1 and templat0 databases > but some how still the age(datfrozenxid keeps incrementing. > My question now is do I have to vacuum daily template1 and template0 > databse, is there any harm on vacuuming these databases daily ?, since > these are postgres system tables I am kind of worried. I was told that > template0 is freezed but not sure why the age(datfrozenxid keeps > incrementing. I am going to vacuum usps from now anyway. We are using > Postgres version 8.0.2 You should upgrade to 8.0.6; data loss bugs have been fixed in there. If you never update USPS you can do a vacuum freeze on it and you won't need to worry about XID rollover. Same with template1. But if they're small databases it's probably safer just to periodically vacuum (once a month or so). If you up to 8.1 and enable autovacuum, it should take care of all of this for you. -- 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