pg.ddx.io  pgsql-admin@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Preston <unsane@idl.com.au>
To: Tom Lane <tgl@sss.pgh.pa.us>
Cc: Preston <unsane@idl.com.au>
Cc: pgsql-admin@postgresql.org
Subject: Re: Vacuuming DVs with few/no updates?
Date: Thu, 06 Feb 2003 16:23:35 +1100 (EST)
Message-ID: <1044509015.3e41f157a06c3@mail.idl.net.au> (raw)
In-Reply-To: <9431.1044508549@sss.pgh.pa.us>
References: <1044480808.3e418328aca17@mail.idl.net.au>
	<9431.1044508549@sss.pgh.pa.us>

Quoting Tom Lane <tgl@sss.pgh.pa.us>:

> Preston <unsane@idl.com.au> 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.

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 30: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...
> 
> 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 do not
enough time" bug.

Does that transaction load include selects?

Due to automated web-based refreshing of views of tables I'd expect the selects
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 transaction
load includes selects...

Cheers,

-Preston.

--
Oops.



view thread (4+ messages)  latest in thread

Message-ID: <1044509015.3e41f157a06c3@mail.idl.net.au>
Permalink:  ../1044509015.3e41f157a06c3@mail.idl.net.au/
Also on:    postgresql.org/message-id/1044509015.3e41f157a06c3@mail.idl.net.au

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-admin@postgresql.org
  Cc: unsane@idl.com.au, tgl@sss.pgh.pa.us
  Subject: Re: Vacuuming DVs with few/no updates?
  In-Reply-To: <1044509015.3e41f157a06c3@mail.idl.net.au>
  References: <1044480808.3e418328aca17@mail.idl.net.au> <9431.1044508549@sss.pgh.pa.us> <1044509015.3e41f157a06c3@mail.idl.net.au>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox