Re: Replication Syatem

From: Greg Smith <gsmith(at)gregsmith(dot)com>
To: Gauri Kanekar <meetgaurikanekar(at)gmail(dot)com>
Cc: pgsql-performance(at)postgresql(dot)org
Subject: Re: Replication Syatem
Date: 2008-04-29 08:37:07
Message-ID: Pine.GSO.4.64.0804290347560.20575@westnet.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-performance

On Tue, 29 Apr 2008, Gauri Kanekar wrote:

> We do vacuum full, as vacuum verbose analyse dont regain space for us.

Ah, now we're getting to the root of your problem here. You expect that
VACUUM should reclaim space.

Whenever you UPDATE a row, it writes a new one out, then switches to use
that version. This leaves behind the original. Those now unused rows are
what VACUUM gathers, but it doesn't give that space back to the operating
system.

The model here assumes that you'll need that space again for the next time
you UPDATE or INSERT a row. So instead VACUUM just keeps those available
for database reuse rather than returning it to the operating system.

Now, if you don't VACUUM frequently enough, this model breaks down, and
the table can get bigger with space that may never get reused. The idea
is that you should be VACUUMing up now unneeded rows at about the same
rate they're being re-used. When you don't keep up, the database can
expand in space that you don't get back again. The right answer to this
problem is not to use VACUUM FULL; it's to use regular VACUUM more often.

--
* Greg Smith gsmith(at)gregsmith(dot)com http://www.gregsmith.com Baltimore, MD

In response to

Responses

Browse pgsql-performance by date

  From Date Subject
Next Message A B 2008-04-29 09:09:48 Re: Where do a novice do to make it run faster?
Previous Message Pavan Deolasee 2008-04-29 05:55:27 Re: Replication Syatem