Re: What to do if space for database decrease and no additional hard drive is possible?

From: Ivan Voras <ivoras(at)freebsd(dot)org>
To: pgsql-general(at)postgresql(dot)org
Subject: Re: What to do if space for database decrease and no additional hard drive is possible?
Date: 2010-07-26 11:43:08
Message-ID: i2jscc$7fe$1@dough.gmane.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On 26.7.2010 12:43, AlannY wrote:
> Hi there.
>
> I have a huge database with several tables. Some tables have statistics
> information. And it's very huge. I don't want to loose any of this data.
> But hard drives on my single server are not eternal. Very soon, there will
> be no left space. And the most awful this, that it's a 1U server, and I
> can't install new hard drive.
>
> What can I do to enlarge space, without loosing data and performance?

Absolutely nothing quick and easy. In fact, about the only thing you can
do which won't cause a (long term) data loss and performance degradation
is a full backup, installing bigger drives to replace the old ones, and
full restore.

Some other ideas which might help you if you don't want to swap drives,
but generally require a lot of work and you *will* lose either data or
performance:

* use a file system which supports compression (NTFS on Windows, ZFS on
FreeBSD & Solaris, don't know any on Linux)
* move unneeded data out from the database and into a separate,
compressed data storage format (e.g. move statistical data into gzipped
csv or text files or something to that effect)
* buy external storage (NAS, or even an external USB drive), move the
database to it
* use an external data storage service like amazon s3 (actually, this is
a bad idea since you will need to completely rewrite your database and
application)
* decide that you really don't need some of the data and just delete it.

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Ralf Schuchardt 2010-07-26 11:44:01 Re: Data dumps to files - best methods?
Previous Message Sam Mason 2010-07-26 10:47:53 Re: Server load statistics