X-Original-To: pgsql-admin@postgresql.org Received: from localhost (postgresql.org [64.49.215.8]) by postgresql.org (Postfix) with ESMTP id AE4844758E1 for ; Thu, 6 Feb 2003 00:15:57 -0500 (EST) Received: from sss.pgh.pa.us (unknown [192.204.191.242]) by postgresql.org (Postfix) with ESMTP id 1B006474E44 for ; Thu, 6 Feb 2003 00:15:57 -0500 (EST) Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss.pgh.pa.us (8.12.6/8.12.6) with ESMTP id h165Fn5u009432; Thu, 6 Feb 2003 00:15:49 -0500 (EST) To: Preston Cc: pgsql-admin@postgresql.org Subject: Re: Vacuuming DVs with few/no updates? In-reply-to: <1044480808.3e418328aca17@mail.idl.net.au> References: <1044480808.3e418328aca17@mail.idl.net.au> Comments: In-reply-to Preston message dated "Thu, 06 Feb 2003 08:33:28 +1100" Date: Thu, 06 Feb 2003 00:15:49 -0500 Message-ID: <9431.1044508549@sss.pgh.pa.us> From: Tom Lane X-Virus-Scanned: by AMaViS new-20020517 X-Archive-Number: 200302/72 X-Sequence-Number: 7270 Preston writes: > Just wondering about how useful the vacuumdb functionality is for a database > that pretty much only ever gets inserts/selects. > I've got a database that is intended for next-to-no deletion of > records, which is where I see the vacuum facility mostly intended > for. I.e., while there'll be the occasional record edits, these edits > will primarily be of the form of adjusting integer records (and > therefore shouldn't adjust any space requirements for a row). You have an important misconception lurking in there. In Postgres, an UPDATE is equivalent to INSERT (of the new row version) followed by DELETE (of the old row version). Therefore, it creates dead rows that need to be reclaimed by VACUUM, just as much as DELETE would do. But yeah, if you have very very few updates or deletes then you don't need to vacuum very often. (You might possibly need to ANALYZE more often than you VACUUM, if statistics like column min/max values are changing significantly due to the insertion traffic.) > I'm thinking that with this database I'll configure vacuumdb to only > run once a month or so. But before I do that I want to make sure I'm > not missing some other important functionality that it does... You should read the discussion of transaction wraparound in the Admin Guide's chapter about routine maintenance (specifically VACUUM ;-)). Once-a-month vacuum is fine if your total transaction load doesn't exceed 1 billion per month ... regards, tom lane