Received: from localhost (unknown [200.46.204.183]) by postgresql.org (Postfix) with ESMTP id 32108650258 for ; Tue, 26 Aug 2008 22:57:39 -0300 (ADT) Received: from postgresql.org ([200.46.204.86]) by localhost (mx1.hub.org [200.46.204.183]) (amavisd-maia, port 10024) with ESMTP id 16667-10 for ; Tue, 26 Aug 2008 22:57:30 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from lists.commandprompt.com (host-159.commandprompt.net [207.173.203.159]) by postgresql.org (Postfix) with ESMTP id 20884650225 for ; Tue, 26 Aug 2008 22:57:35 -0300 (ADT) Received: from perhan.alvh.no-ip.org (190-95-19-36.bk17-dsl.surnet.cl [190.95.19.36]) (authenticated bits=0) by lists.commandprompt.com (8.13.8/8.13.8) with ESMTP id m7R1xotT016559 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Tue, 26 Aug 2008 18:59:54 -0700 Received: by perhan.alvh.no-ip.org (Postfix, from userid 1000) id 439BD47CA5; Tue, 26 Aug 2008 21:56:44 -0400 (CLT) Date: Tue, 26 Aug 2008 21:56:44 -0400 From: Alvaro Herrera To: Duan Ligong Cc: pgsql-performance@postgresql.org Subject: Re: control the number of clog files and xlog files Message-ID: <20080827015644.GW4920@alvh.no-ip.org> References: <20080827085439.22A4.DUANLG@nec-as.nec.com.cn> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20080827085439.22A4.DUANLG@nec-as.nec.com.cn> User-Agent: Mutt/1.5.18 (2008-05-17) X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.0 (lists.commandprompt.com [207.173.203.159]); Tue, 26 Aug 2008 18:59:55 -0700 (PDT) X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=0 tagged_above=0 required=5 tests=none X-Spam-Level: X-Archive-Number: 200808/343 X-Sequence-Number: 31224 Duan Ligong wrote: > Would you like to be so kind as to answer the following questions: > > - Is there any way to control the number of clog files and xlog files? > I encounter an issue that there are too many clog files under the > pg_clog/ directory which occupy more space than I can endure.. pg_clog files are controlled by tuple freezing, which is done by vacuum, and it depends on the autovacuum_min_freeze_age parameter and vacuum_freeze_min_age. Please read http://www.postgresql.org/docs/8.3/interactive/routine-vacuuming.html and http://www.postgresql.org/docs/8.3/interactive/runtime-config-client.html#GUC-VACUUM-FREEZE-MIN-AGE > - What determines the number of clog files? what determines the > number of xlog files? The number of xlog files will depend on checkpoints. You need to restrict checkpoint_segments to control this. Note that this can have a serious performance impact. > - I understand pg_xlog is used to record WAL. but what is pg_clog > is used to? Is it used to record some meta-information on the xlog? clog is the "commit log", i.e. it records transactions that have been committed and those that have been aborted. You cannot delete files unless you want to corrupt your database. > - What effect does Deleting the clog and xlogfiles bring about? > Will it cause Postgresql abnormal stopping? Your data will be corrupt. It may continue to work for a while, and suddenly stop working at a future time. -- Alvaro Herrera http://www.CommandPrompt.com/ The PostgreSQL Company - Command Prompt, Inc.