Received: from localhost (unknown [200.46.204.184]) by developer.postgresql.org (Postfix) with ESMTP id 67DB92E002D for ; Tue, 29 Apr 2008 11:16:30 -0300 (ADT) Received: from developer.postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.184]) (amavisd-maia, port 10024) with ESMTP id 05381-07-2 for ; Tue, 29 Apr 2008 11:16:05 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey-1.7.5 Received: from sss.pgh.pa.us (sss.pgh.pa.us [66.207.139.130]) by developer.postgresql.org (Postfix) with ESMTP id 7B1102E0085 for ; Tue, 29 Apr 2008 11:16:14 -0300 (ADT) Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.2/8.14.2) with ESMTP id m3TEG2rX000874; Tue, 29 Apr 2008 10:16:02 -0400 (EDT) To: Greg Smith cc: Gauri Kanekar , pgsql-performance@postgresql.org Subject: Re: Replication Syatem In-reply-to: References: <7e4ba9550804280638ie81dc23w472785c83cd38fcf@mail.gmail.com> <7e4ba9550804280705q43c51e66l104a5ff9272bbd4d@mail.gmail.com> <20080428162243.GN2970@commandprompt.com> <7e4ba9550804282246p73c62fc6y5e7cb7dda55a6b50@mail.gmail.com> Comments: In-reply-to Greg Smith message dated "Tue, 29 Apr 2008 04:37:07 -0400" Date: Tue, 29 Apr 2008 10:16:02 -0400 Message-ID: <873.1209478562@sss.pgh.pa.us> From: Tom Lane X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200804/441 X-Sequence-Number: 29934 Greg Smith writes: > The model here assumes that you'll need that space again for the next time > you UPDATE or INSERT a row. So instead VACUUM just keeps those available > for database reuse rather than returning it to the operating system. > Now, if you don't VACUUM frequently enough, this model breaks down, and > the table can get bigger with space that may never get reused. The idea > is that you should be VACUUMing up now unneeded rows at about the same > rate they're being re-used. When you don't keep up, the database can > expand in space that you don't get back again. The right answer to this > problem is not to use VACUUM FULL; it's to use regular VACUUM more often. Also, you need to make sure you have the FSM parameters set high enough so that all the free space found by a VACUUM run can be remembered. The less often you run VACUUM, the more FSM space you need, because there'll be more free space reclaimed per run. regards, tom lane