X-Original-To: pgsql-admin-postgresql.org@localhost.postgresql.org Received: from localhost (mx1.hub.org [200.46.208.251]) by postgresql.org (Postfix) with ESMTP id A343811F6C8B for ; Mon, 24 Apr 2006 16:53:21 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.208.251]) (amavisd-new, port 10024) with ESMTP id 81704-01-2 for ; Mon, 24 Apr 2006 16:52:46 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey- Received: from mx3.surnet.cl (mx3.surnet.cl [216.155.73.182]) by postgresql.org (Postfix) with ESMTP id 0673A11F9118 for ; Mon, 24 Apr 2006 16:06:04 -0300 (ADT) Received: from unknown (HELO cluster.surnet.cl) ([216.155.73.165]) by mx3.surnet.cl with ESMTP; 24 Apr 2006 15:06:04 -0400 X-IronPort-AV: i="4.04,152,1144036800"; d="scan'208"; a="6169100:sNHT18470636" Received: from alvh.no-ip.org (200.126.100.190) by cluster.surnet.cl (7.0.043) (authenticated as alvherre@surnet.cl) id 443B7DDC001C0317; Mon, 24 Apr 2006 15:06:04 -0400 Received: by alvh.no-ip.org (Postfix, from userid 1000) id EBA7EC30F8E; Mon, 24 Apr 2006 15:06:03 -0400 (CLT) Date: Mon, 24 Apr 2006 15:06:03 -0400 From: Alvaro Herrera To: "Jim C. Nasby" Cc: Gourish Singbal , "pgsql-admin@postgresql.org" Subject: Re: Autovacuuming Message-ID: <20060424190603.GC16134@surnet.cl> Mail-Followup-To: "Jim C. Nasby" , Gourish Singbal , "pgsql-admin@postgresql.org" References: <674d1f8a0604232251v4649b456xc542fd831f8db4@mail.gmail.com> <20060424124155.GA13361@surnet.cl> <20060424180038.GG48010@pervasive.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20060424180038.GG48010@pervasive.com> User-Agent: Mutt/1.5.11+cvs20060403 X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200604/249 X-Sequence-Number: 21418 Jim C. Nasby wrote: > On Mon, Apr 24, 2006 at 08:41:55AM -0400, Alvaro Herrera wrote: > > The test for database-wide vacuum is: > > > > database age > big_constant > > > > where: > > > > big_constant = (MaxTransactionId >> 3) * 3 - 100000) = 1610512733 > > Ok, I'll bite... any idea how (MaxTransactionId >> 3) * 3 was chosen? I > don't see anything about it in vacuum.c... I don't remember exactly why was that constant chosen. IIRC Tom pulled it out of thin air. You can see in vac_truncate_clog (vacuum.c) a similar constant is used to emit messages about impending wraparound; it's ((MaxTransactionId >> 3) * 3). The one in autovacuum.c allows for more slack. (Which is kinda right because we want autovac to take care of it _before_ the user sees any warning.) > Also, maybe that should be defined in one place rather than duplicating > it in autovacuum.c? Hmm ... do you care enough to send a patch? -- Alvaro Herrera http://www.CommandPrompt.com/ PostgreSQL Replication, Consulting, Custom Development, 24x7 support