Skip site navigation (1) Skip section navigation (2)

Re: slow query

From: Robert Treat <xzilla(at)users(dot)sourceforge(dot)net>
To: Josh Berkus <josh(at)agliodbs(dot)com>
Cc: Clarence Gardner <clarence(at)silcom(dot)com>,Oleg Lebedev <oleg(dot)lebedev(at)waterford(dot)org>,"pgsql-performance(at)postgresql(dot)org" <pgsql-performance(at)postgresql(dot)org>
Subject: Re: slow query
Date: 2003-02-24 19:58:57
Message-ID: 1046116737.1014.284.camel@camel (view raw, whole thread or download thread mbox)
Lists: pgsql-performance
On Mon, 2003-02-24 at 13:45, Josh Berkus wrote:
> Robert,
> > Actually if you are vacuuming frequently enough, it can (and should*)
> > obviate a vacuum full. Be aware that frequently enough might mean really
> > frequent, for instance I have several tables in my database that update
> > every row within a 15 minute timeframe, so I run a "lazy" vacuum on
> > these tables every 10 minutes. This allows postgresql to reuse the space
> > for these tables almost continuously so I never have to vacuum full
> > them.
> This would assume absolutely perfect FSM settings, and that the DB never gets 
> thrown off by unexpected loads.  I have never been so fortunate as to work 
> with such a database.   However, I agree that good FSM tuning and frequent 
> regular VACUUMs can greatly extend the period required for running FULL.

It's somewhat relative. On one of my tables, it has about 600 rows, each
row gets updated within 15 minutes. I vacuum it every 10 minutes, which
should leave me with around 1000 tuples (dead and alive) for that table,
Even if something overload the updates on that table, chances are that I
wouldn't see enough of a performance drop to warrant a vacuum full. Of
course, its a small table, so YMMV.  I think the point is though that if
your running nightly vacuum fulls just to stay ahead of the game, your
not maintaining the database optimally.

> I have not found, though, that this does anything to prevent the need for 
> REINDEX on frequently-updated tables.  How about you, Robert?

Well, this touches on a different topic. On those tables where I get
"index bloat", I do have to do REINDEX's. But that's not currently
solvable with vacuum (remember indexes dont even use FSM) though IIRC
Tom & Co. have done some work toward this for 7.4

Robert Treat

In response to

pgsql-performance by date

Next:From: Tom LaneDate: 2003-02-24 20:17:40
Subject: Re: Memory taken by FSM_relations
Previous:From: Josh BerkusDate: 2003-02-24 19:55:45
Subject: Re: Memory taken by FSM_relations

Privacy Policy | About PostgreSQL
Copyright © 1996-2018 The PostgreSQL Global Development Group