pg.ddx.io  pgsql-performance@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Andrew Sullivan <ajs@crankycanuck.ca>
To: pgsql-performance@postgresql.org
Subject: Re: [ADMIN] reclaiming disk space after major updates
Date: Fri, 8 Jun 2007 11:10:57 -0400
Message-ID: <20070608151057.GG17144@phlogiston.dyndns.org> (raw)
In-Reply-To: <466967C4.70606@drivefaster.net>
References: <46672F7C.4020400@drivefaster.net>
	<20070607192025.GO14087@phlogiston.dyndns.org>
	<46687820.9000604@drivefaster.net>
	<20070608140354.GV17144@phlogiston.dyndns.org>
	<466967C4.70606@drivefaster.net>

On Fri, Jun 08, 2007 at 08:29:24AM -0600, Dan Harris wrote:
> 
> One more point in my original post.. For my own education, why does VACUUM 
> FULL prevent reads to a table when running (I'm sure there's a good 
> reason)?  I can certainly understand blocking writes, but if I could still 
> read from it, I'd have no problems at all!

It has to take an exclusive lock, because it actually moves the bits
around on disk.  Since your SELECT query could be asking for data
that is actually in-flight, you lose.  This is conceptually similar
to the way defrag works on old FAT-type filesystems: if you used one,
you'll remember that when you were defragging your disk, if you did
anything else on that disk the defrag would keep restarting.  This
was because the OS was trying to move bits around, and when you did
stuff, you screwed up its optimization.  The database works
differently, by taking an exclusive lock, but the basic conceptual
problem is the same.

A

-- 
Andrew Sullivan  | ajs@crankycanuck.ca
Unfortunately reformatting the Internet is a little more painful 
than reformatting your hard drive when it gets out of whack.
		--Scott Morris



view thread (6+ messages)

Message-ID: <20070608151057.GG17144@phlogiston.dyndns.org>
Permalink:  ../20070608151057.GG17144@phlogiston.dyndns.org/
Also on:    postgresql.org/message-id/20070608151057.GG17144@phlogiston.dyndns.org

 · 

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 using the --to and --cc options:
  reply via email

  To: pgsql-performance@postgresql.org
  Cc: ajs@crankycanuck.ca
  Subject: Re: [ADMIN] reclaiming disk space after major updates
  In-Reply-To: <20070608151057.GG17144@phlogiston.dyndns.org>

* 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