pg.ddx.io  pgsql-admin@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Michael Kussmaul <kussmaul.list@nix.ch>
To: pgsql-admin@postgresql.org
Subject: VACUUM FULL into another tablespace?
Date: Fri, 14 Jun 2013 19:04:19 +0200
Message-ID: <762524C5-AC0B-48C5-897E-6313C1ABC52E@nix.ch> (raw)
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-admin>

I have a very large table on my PostgreSQL 9.1 database (openstreetmap data: 64GB data + 100GB indexes in one particular table) stored on a dedicated 220GB SSD-disk (tablespace "SSD"). I would like to run "VACUUM (FULL, FREEZE, ANALYZE)" on that table to reclaim some tablespace. But as you can see, such an operation fails, because rebuilding that table takes an additional 160GB of data - the SSD is just too small for that.

What I did in the past, was changing the tablespace of that huge table to my normal disk (4TB, tablespace "DEFAULT"), run VACUUM there, then changing back the tablespace to "SSD". This just takes a very long time, because all the heavy re-indexing now takes place on my very slow normal disk.

I was wondering if there is a way to directly "VACUUM + alter the table space" in one operation? So basically, the db would read the table on "SSD" and places the resulting vacuumed table on tablespace "DEFAULT".

Looking at the vacuum man-page this seems not possible - but perhaps I'm missing something or there exists some workarounds to achieve something similar (reclaiming space)?

kind regards
Michael

-- 
Sent via pgsql-admin mailing list (pgsql-admin@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-admin



Message-ID: <762524C5-AC0B-48C5-897E-6313C1ABC52E@nix.ch>
Permalink:  ../762524C5-AC0B-48C5-897E-6313C1ABC52E@nix.ch/
Also on:    postgresql.org/message-id/762524C5-AC0B-48C5-897E-6313C1ABC52E@nix.ch

 · 

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-admin@postgresql.org
  Cc: kussmaul.list@nix.ch
  Subject: Re: VACUUM FULL into another tablespace?
  In-Reply-To: <762524C5-AC0B-48C5-897E-6313C1ABC52E@nix.ch>
  References: <762524C5-AC0B-48C5-897E-6313C1ABC52E@nix.ch>

* 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