Re: Re: dramatic slowdown. . .fixed by vacuum

Marc G. Fournier <scrappy@hub.org>

From: The Hermit Hacker <scrappy@hub.org>
To: Joe Slag <jslag@visi.com>
Cc: pgsql-novice@postgresql.org
Date: 2000-07-21T20:20:23Z
Lists: pgsql-novice
On Fri, 21 Jul 2000, Joe Slag wrote:

> On Fri, Jul 21, 2000 at 12:36:35PM -0700, WOLF, PATRICK wrote:
> > Try running vacuum on the table or the database.  Here's an excerpt from the
> > man on vacuum:
> > 
> [snip]
> > 
> > 
> 
> Thanks to all who responded.  I vacuumed out foo, and sure enough 
> the select time is down to 10 seconds again.
> 
> I see in the docs the suggestion: 
> 
>     We recommend that active production databases be VACUUMM-ed nightly
> 
> Is this how people tend to do their vacuuming?  Does anyone do programmatic
> vacuums instead of / in addition to a nightly run?  Is vacuuming mainly
> necessary after big deletes, or are there other common situations 
> requiring it?

UPDATEs are a combination of 'INSERT new tuple/mark old as DELETEd', so
for each UPDATE, you are adding one more tuple to the table but not
removing anything.  VACUUM removes that DELETEd tuple.