From: bangh <banghe@baileylink.net>
To: Leong, Fushan <fushan.leong@SonoSite.com>
Cc: pgsql-admin@postgresql.org
Subject: Re: Vaccum
Date: Thu, 29 Nov 2001 12:25:13 -0600
Message-ID: <3C067D89.F07D833F@baileylink.net> (raw)
References: <2DFBC8374F5A0F4E954C07C158844F323886DC@milton.sonosite.com>
HI,
This is not necessary true, but you might feel understandable.
To delete records, just seems as the records are marked as voided. Space is not
collected. To run vaccum might do this kind space garbage collection.
To run vacummdb really save the space, but it works at only some extent. e.g.
index still goes quickly, it goes bigger and bigger, one day it eats all your
space you have, behaves as gets a virus. In this case, my solution is to use
pg_dump the original one, create new one and restory, this reaaly save your
space, but you cannot do this as frequently as you do "vacuum". It costs much
more CPU time to do it if your database is huge.
Bangh
"Leong, Fushan" wrote:
> You said "when you delete the records, the space does not get compressed".
> Can you explain
> more for me. The reason I want to run vacuumdb is to free up some space so
> the database will
> not grow forever..........
>
> -----Original Message-----
> From: bangh [mailto:banghe@baileylink.net]
> Sent: Thursday, November 29, 2001 10:01 AM
> To: Leong, Fushan
> Cc: pgsql-admin@postgresql.org
> Subject: Re: [ADMIN] Vaccum
>
> Hello,
>
> You can use vacuum at different levels.
>
> As a command you can use vacuumdb database_name.
>
> In psql, you can use
> psql> vacuum table_name;
>
> I don't think it is going to delete records. To delete records you need to
> issue SQL command:
> like: delete from table_name where condi.
>
> It must delete the cells. when you delete the reocrds, the space does not
> get compressed.
>
> You can check the size changes of a table or database before and after you
> issue "vacuum" command.
>
> You don't need to shut down postmoaster.
>
> It would be nice if you do such jobs at midnight, because such a job does
> keep your CPU busy.
>
> Bangh
>
> "Leong, Fushan" wrote:
>
> > Hi :
> >
> > Want to get your opinion.
> >
> > I am thinking to schedule to run Vaccum everynight.
> >
> > 1) As I understand, Vaccum is the command to delete old data, right?
> > 1) Do I have to stop the postmaster before run the Vaccum command?
> > 2) Should I run it everynight? How often should I run it?
> >
> > thanks
> > Fushan
> >
> > ---------------------------(end of broadcast)---------------------------
> > TIP 6: Have you searched our list archives?
> >
> > http://archives.postgresql.org
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: banghe@baileylink.net, fushan.leong@SonoSite.com
Subject: Re: Vaccum
In-Reply-To: <3C067D89.F07D833F@baileylink.net>
References: <2DFBC8374F5A0F4E954C07C158844F323886DC@milton.sonosite.com> <3C067D89.F07D833F@baileylink.net>
* 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