Skip site navigation (1) Skip section navigation (2)

Re: Non-blocking vacuum full

From: Heikki Linnakangas <heikki(at)enterprisedb(dot)com>
To: Peter Schuller <peter(dot)schuller(at)infidyne(dot)com>
Cc: pgsql-performance(at)postgresql(dot)org
Subject: Re: Non-blocking vacuum full
Date: 2007-09-28 19:31:33
Message-ID: 46FD5695.6000302@enterprisedb.com (view raw or flat)
Thread:
Lists: pgsql-performance
Peter Schuller wrote:
> I have only looked very very briefly at the PG code so I don't know
> how far fetched it is, but my thought was that it should be possible
> to have a slow background process (similar to normal non-full vacuums
> nows) that would, instead of registering dead tuples in the FSM, move
> live tuples around.

What you've described is actually very close to VACUUM FULL. VACUUM FULL
needs to take an exclusive lock to lock out concurrent scanners that
might miss or see a tuple twice, when a live tuple is moved. That's the
fundamental problem you need to solve.

I think it's doable, if you take a copy of the tuple, and set the ctid
pointer on the old one like an UPDATE, and wait until the old tuple is
no longer visible to anyone before removing it. It does require some
changes to tuple visibility code. For example, a transaction running in
serializable mode shouldn't throw a serialization error when it tries to
update an old, moved row version, but follow the ctid pointer instead.

-- 
  Heikki Linnakangas
  EnterpriseDB   http://www.enterprisedb.com

In response to

Responses

pgsql-performance by date

Next:From: Tom LaneDate: 2007-09-28 20:56:49
Subject: Re: OOM Errors as a result of table inheritance and a bad plan(?)
Previous:From: Peter SchullerDate: 2007-09-28 18:06:50
Subject: Non-blocking vacuum full

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group