pg.ddx.io  pgsql-general@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Ed Loehr <eloehr@austin.rr.com>
Cc: pgsql-general@postgreSQL.org
Subject: Re: Vacuum Question
Date: Fri, 02 Jun 2000 11:11:03 -0400
Message-ID: <14982.959958663@sss.pgh.pa.us> (raw)
In-Reply-To: <3937C85E.88ADA7EC@austin.rr.com>
References: <20000601091701.631.qmail@mail01.edsamail.com.ph>
	<13854.959924635@sss.pgh.pa.us>
	<3937C85E.88ADA7EC@austin.rr.com>

Ed Loehr <eloehr@austin.rr.com> writes:
>> The short answer is that a table being vacuumed is locked against any
>> other access, read or write; but only that one table.  You might as
>> well leave the rest of the database open for use.

> I take it you don't give much credence to the previous reports that
> concurrently writing during vacuuming caused corruption?

No, not really, for the simple reason that there aren't going to *be*
any concurrent writes (or reads either) during a vacuum ... unless our
table locking system fails, in which case we've got lots worse problems
than vacuum.

There are scenarios involving known (and fixed!) bugs that might be
stressed by vacuum running concurrently with operations on other tables.
I'm thinking particularly of shared cache invalidation: a vacuum on a
system table will spit out a lot of SI messages for the tuples it moves
around, and it used to be that we had bugs that could be triggered by
SI buffer overflow, or more accurately by the cache flush that's used to
recover from SI overflow.  (Those bugs seem to be fixed in 7.0.  I've
successfully run parallel regression tests with the SI buffer reduced to
a mere dozen messages or so.  It spits out an impressive number of "SI
buffer overflow" notices, but keeps going...)

If you are feeling conservative you might want to vacuum just selected
user tables during normal usage, and do a database-wide vacuum only at
low load --- if there are any low-probability bugs still lurking in
there, they're almost surely things that would be triggered by system
table vacuums and not user-table vacuums.  That'd probably be a good
idea for performance reasons anyway, since locking a system table is
much more likely to block other backends than locking any one user
table.

			regards, tom lane



view thread (33+ messages)  latest in thread

Message-ID: <14982.959958663@sss.pgh.pa.us>
Permalink:  ../14982.959958663@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/14982.959958663@sss.pgh.pa.us

 · 

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-general@postgresql.org
  Cc: tgl@sss.pgh.pa.us, eloehr@austin.rr.com
  Subject: Re: Vacuum Question
  In-Reply-To: <14982.959958663@sss.pgh.pa.us>
  References: <20000601091701.631.qmail@mail01.edsamail.com.ph> <13854.959924635@sss.pgh.pa.us> <3937C85E.88ADA7EC@austin.rr.com> <14982.959958663@sss.pgh.pa.us>

* 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