X-Original-To: pgsql-admin@postgresql.org Received: from localhost (postgresql.org [64.49.215.8]) by postgresql.org (Postfix) with ESMTP id 6EFED475C45 for ; Thu, 6 Feb 2003 00:26:35 -0500 (EST) Received: from data.idl.com.au (data.idl.com.au [203.32.82.9]) by postgresql.org (Postfix) with ESMTP id A8071475AA1 for ; Thu, 6 Feb 2003 00:26:15 -0500 (EST) Received: from bishop.idl.com.au (bishop.idl.com.au [203.33.254.156]) by data.idl.com.au (8.12.3/8.12.3/Debian -4) with ESMTP id h164eJH0014104; Thu, 6 Feb 2003 15:40:19 +1100 Received: (from www-data@localhost) by bishop.idl.com.au (8.9.3/8.9.3/Debian 8.9.3-21) id QAA20797; Thu, 6 Feb 2003 16:23:35 +1100 X-Authentication-Warning: bishop.idl.com.au: www-data set sender to unsane@idl.com.au using -f To: Tom Lane Subject: Re: Vacuuming DVs with few/no updates? Message-ID: <1044509015.3e41f157a06c3@mail.idl.net.au> Date: Thu, 06 Feb 2003 16:23:35 +1100 (EST) From: Preston Cc: Preston , pgsql-admin@postgresql.org References: <1044480808.3e418328aca17@mail.idl.net.au> <9431.1044508549@sss.pgh.pa.us> In-Reply-To: <9431.1044508549@sss.pgh.pa.us> MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 User-Agent: IMP/PHP IMAP webmail program 2.2.6 X-Originating-IP: 203.110.157.48 Content-Transfer-Encoding: quoted-printable X-Virus-Scanned: by AMaViS new-20020517 X-Archive-Number: 200302/73 X-Sequence-Number: 7271 Quoting Tom Lane : > Preston writes: > > Just wondering about how useful the vacuumdb functionality is for a > > database > > that pretty much only ever gets inserts/selects. >=20 > > 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). >=20 > 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. Ah OK - thanks for explaining that to me. It changes my outlook quite a bit. However, the inserts will still outnumber the updates on a scale of about 3= 0:1. > 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.) OK, will look into that side of it. > > 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... >=20 > 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 ... Thanks - will find and read that... Once again caught by the "too much to d= o not enough time" bug. Does that transaction load include selects? Due to automated web-based refreshing of views of tables I'd expect the sel= ects to number around 2,000 to 10,000 per day... I know that's still not anywhere near a billion but it's to the point of a more interesting amount if transa= ction load includes selects... Cheers, -Preston. -- Oops.