Re: VACUUMing a live site OK?

From: Stephan Szabo <sszabo(at)megazone23(dot)bigpanda(dot)com>
To: Shuzo Kubo <gardenweasel(at)hotmail(dot)com>
Cc: pgsql-admin(at)postgresql(dot)org
Subject: Re: VACUUMing a live site OK?
Date: 2001-10-19 16:08:12
Message-ID: Pine.BSF.4.21.0110190906270.32118-100000@megazone23.bigpanda.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-admin

On Fri, 19 Oct 2001, Shuzo Kubo wrote:

> Hi,
>
> I have a web application using PostgreSQL 7.1.3 with a table that
> experiences alot of UPDATEs. I shouldn't be updating the data so much to
> start off with but can no longer avoid the situation.
>
> I would like to vacuum a table (1 table only) to maintain an acceptable
> performance. Is it safe to vacuum a table when users are attempting to
> SELECT from or UPDATE to it? I would imagine that the table would get locked
> and there should be no problems.

That should be fine. The vacuum should wait until any transactions
currently locking the table finish and any other transactions that want to
access the table should wait for the vacuum. One warning is that if you
have any kind of persistant connections, you may see things were a
transaction has a lock and goes idle (no statements) which will cause
the vacuum to sit and wait and other transactions to line up behind it.

In response to

Browse pgsql-admin by date

  From Date Subject
Next Message James Kelty 2001-10-19 20:13:27 Rename of a Table Column
Previous Message Allan Engelhardt 2001-10-19 15:02:38 [repost] pg_restore doesn't work with custom format?