Re: Is vacuum full lock like old's vacuum's lock?

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Andrew Sullivan <andrew(at)libertyrms(dot)info>
Cc: PostgreSQL general list <pgsql-general(at)postgresql(dot)org>
Subject: Re: Is vacuum full lock like old's vacuum's lock?
Date: 2002-03-02 18:55:07
Message-ID: 15625.1015095307@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Andrew Sullivan <andrew(at)libertyrms(dot)info> writes:
> I thought that, in the case Mr Reyes is talking about, Postgres would
> again use the freed disk space. It's just that the space would not
> be available to other applications. I thought what VACUUM FULL did
> was just free the disk space _absolutely_.
> If I'm right, does that also mean that performance is actually
> (marginally) _better_ in these types of cases, because the system
> doesn't need to request new disk blocks from the OS?

For situations where your turnover between vacuums is a small part
of the table (say up to 10% or so), I think VACUUM is a clear win
over VACUUM FULL. As you say, there's little percentage in doing
a lot of tuple-shuffling in order to return some disk blocks to
the OS, if you're only going to need the space back again soon.
Might as well accept some steady-state space overhead.

However, in Francisco's case he wants to completely replace the
table contents --- and if he wants to maintain service to clients
while he does it, then there's no way around the fact that the
peak space consumption is going to be twice the nominal table size.
(Can't invalidate the old tuples till you've loaded all the new
ones.) So if he just does VACUUMs then he's going to have a
steady-state space consumption 2x larger than minimum, not a few
percent larger than minimum. That might be annoying --- particularly
if he's got queries that do sequential scans of the table. Might be
worth a VACUUM FULL to knock the space usage back down.

(On the other hand, if the goal is "continuous service" then I
think VACUUM FULL is out of the question anyway; it'll lock down
the table for too long.)

regards, tom lane

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Masaru Sugawara 2002-03-02 22:28:00 Re: help with getting index scan
Previous Message Andrew Sullivan 2002-03-02 18:20:32 Re: Is vacuum full lock like old's vacuum's lock?