pg.ddx.io  pgsql-admin@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tino Schwarze <postgresql@tisc.de>
To: pgsql-admin@postgresql.org
Subject: Re: Vacuum wait time problem
Date: Fri, 13 Feb 2009 23:34:53 +0100
Message-ID: <20090213223453.GH12562@easy2.in-chemnitz.de> (raw)
In-Reply-To: <dcc563d10902131413x3de3936fkdf4348a3ec22dbe6@mail.gmail.com>
References: <4995ABC0.4090401@musicreports.com>
	<dcc563d10902131321h548104a0vdf3d16f0dc27f015@mail.gmail.com>
	<4995EC90.5020200@musicreports.com>
	<dcc563d10902131413x3de3936fkdf4348a3ec22dbe6@mail.gmail.com>

On Fri, Feb 13, 2009 at 03:13:28PM -0700, Scott Marlowe wrote:

[...]

> Yeah, that's pretty bad.  ~2 Million live rows and ~18 Million dead
> ones is a pretty badly bloated table.
> 
> Vacuum full is one way to reclaim that lost space.  You can also dump
> and restore that one table, inside a drop / create restraints in a
> transaction during maintenance if you can.  A Vacuum full is quite
> intrusive, so avoid it during normal working hours.  Dumping and
> reloading the whole db may be faster than either a vacuum full or a
> cluster.    A common trick is to do something like:
> 
> begin;
> select * into ordermydata from bigbloatedtable order by some_field;
> delete * from bigbloatedtable;
> insert into bigbloatedtable select * from ordermydata;
> commit;
> 
> This will both put your table in some order which might help, and
> remove the bloat.

Really? Wouldn't that add even more bloat? How does that work? (I'd
expect a drop table/create table instead of the delete...)
Note: I suppose that you know a lot more about PG than I do, so I'm just
curious.

Thanks,

Tino.

-- 
"What we nourish flourishes." - "Was wir nähren erblüht."

www.lichtkreis-chemnitz.de
www.craniosacralzentrum.de



view thread (15+ messages)  latest in thread

Message-ID: <20090213223453.GH12562@easy2.in-chemnitz.de>
Permalink:  ../20090213223453.GH12562@easy2.in-chemnitz.de/
Also on:    postgresql.org/message-id/20090213223453.GH12562@easy2.in-chemnitz.de

 · 

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-admin@postgresql.org
  Cc: postgresql@tisc.de
  Subject: Re: Vacuum wait time problem
  In-Reply-To: <20090213223453.GH12562@easy2.in-chemnitz.de>

* 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