Received: from localhost (maia-2.hub.org [200.46.204.187]) by postgresql.org (Postfix) with ESMTP id 31F029FB60A for ; Thu, 25 Jan 2007 06:29:36 -0400 (AST) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.187]) (amavisd-new, port 10024) with ESMTP id 88257-08 for ; Thu, 25 Jan 2007 06:29:18 -0400 (AST) X-Greylist: from auto-whitelisted by SQLgrey-1.7.4 Received: from serv1.oss.ntt.co.jp (ns.oss.ntt.co.jp [222.151.198.98]) by postgresql.org (Postfix) with ESMTP id 5F2CE9FB5D8 for ; Thu, 25 Jan 2007 06:29:27 -0400 (AST) Received: from [127.0.0.1] (unknown [172.17.1.148]) by serv1.oss.ntt.co.jp (Postfix) with ESMTP id BA8F2260046; Thu, 25 Jan 2007 19:29:24 +0900 (JST) Message-ID: <45B88680.4040500@oss.ntt.co.jp> Date: Thu, 25 Jan 2007 19:29:20 +0900 From: Galy Lee User-Agent: Thunderbird 1.5.0.9 (Windows/20061207) MIME-Version: 1.0 To: pgsql-performance@postgresql.org CC: jim@nasby.net Subject: Re: how to plan for vacuum? References: <45B6F0A8.1050705@oss.ntt.co.jp> <20070125033917.GD64372@nasby.net> In-Reply-To: <20070125033917.GD64372@nasby.net> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200701/368 X-Sequence-Number: 22969 Jim C. Nasby wrote: > On Wed, Jan 24, 2007 at 02:37:44PM +0900, Galy Lee wrote: >> 1. How do we know if autovacuum is enough for my application, or should >> I setup a vacuum manually from cron for my application? > > Generally I trust autovac unless there's some tables where it's critical > that they be vacuumed frequently, such as a queue table or a web session > table. So how much can we trust autovac? I think at least the following cases can not be covered by autovac now: - small but high update tables which are sensitive to garbage - very big tables which need a long time to be vacuumed. - when we need to adjust the the max_fsm_page >> 2. How to set the GUC parameters for autovacuum? >> There are two sets of parameters for autovacuum: >> - vacuum threshold and scale factor (500/0.2) >> ?$B!! - analyze threshold and scale factor(250/0.1) >> Is there any guideline to set these parameters? When does it need to >> change the default values? > > I find those are generally pretty good starting points; just bear in > mind that it means 20% dead space. so what is the principle to set them? - keep dead space lower than some disk limit - or keep the garbage rate lower than fillfactor or any other general principle?