From: Matt Clark <matt@ymogen.net>
To: Rob Nagler <nagler@bivio.biz>
To: pgsql-performance@postgresql.org
Subject: Re: reindex/vacuum locking/performance?
Date: Sat, 4 Oct 2003 00:21:32 +0100
Message-ID: <LFEIJBEOKGPDHCEMDGNFMEOBCFAA.matt@ymogen.net> (raw)
In-Reply-To: <16253.61013.56254.526139@jump.bivio.com>
> > vacuum full does require exclusive lock, plain vacuum does not.
>
> I think I need full, because there are updates on the table. As I
> understand it, an update in pg is an insert/delete, so it needs
> to be garbage collected.
Yes and no. You only need a plain VACUUM that is run often enough to
recover space as fast as you need to grab it. For heavily updated tables
run it often - I run it every 5 minutes on some tables. A VACUUM FULL is
only needed if you haven't been running VACUUM often enough in the first
place.
> The description of vacuum full implies that is required if the db
> is updated frequently. This db gets about 1 txn a second, possibly
> more at peak load.
Assuming you mean 1 update/insert per second that is an absolutely _trivial_
load on any reasonable hardware. You can do thousands of updates/second on
hardware costing less than $2000. If you vacuum every hour then you will be
fine.
> IOW, vacuum+reindex is faster than dump+restore? I didn't see this,
> then again, I had this locking problem, so the stats are distorted.
REINDEX also locks tables like VACUUM FULL. Either is terribly slow, but
unless you turn off fsync during the restore it's unlikely to be slower than
dump & restore.
Matt
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 using the --to and --cc options:
reply via email
To: pgsql-performance@postgresql.org
Cc: matt@ymogen.net, nagler@bivio.biz
Subject: Re: reindex/vacuum locking/performance?
In-Reply-To: <LFEIJBEOKGPDHCEMDGNFMEOBCFAA.matt@ymogen.net>
* 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