From: Robert Treat <xzilla@users.sourceforge.net>
To: HT Levine <htlevine@ebates.com>
Cc: pgsql-admin@postgresql.org
Subject: Re: max_fsm_pages Sanity Check
Date: 03 Jan 2003 09:44:17 -0500
Message-ID: <1041605057.1983.32.camel@camel> (raw)
In-Reply-To: <av2kmh$1ujh$1@news.hub.org>
References: <1041547656.32015.38.camel@camel>
<av2kmh$1ujh$1@news.hub.org>
On Thu, 2003-01-02 at 19:15, HT Levine wrote:
> see my answers below:
> "Robert Treat" <xzilla@users.sourceforge.net> wrote in message
> news:1041547656.32015.38.camel@camel...
<snip>
> > >
> >
> > Tables with no deletions or updates won't benefit from vacuuming so
> > there's no reason to vacuum them. On a table like Batch_Load_awaiting,
> > you need to do a vacuum after the 100% are updated. If you plan to
> > insert more into this table just do an --analyze, if you don't plan to
> > insert, then --full is more appropriate. Keep an eye on those small
> > tables if they have frequent turnover. Even a 1000 row table that gets
> > updated every 5 minutes will generate more than 250,000 dead tuples a
> > day if your not regularly vacuuming.
>
> batch_load_awaiting (affectionately known as BLA) gets N inserts directly
> followed by N updates once a day. The previous day's update/inserts are not
> touched (except in a blue moon) so I assume this would mean a daily vacuum
> analyze on this guy?
>
Yep, preferably right after your done updating. If done regularly you
shouldn't have to vacuum full this table at all (any new rows can use
the previous days dead updated tuples)
> users depends on how often users decide to update their account, and orders
> would be even smaller (customer service changing user's orders)
>
> Got it on the small tables, I'll keep an eye for those too -- thanks.
>
> >
> > I am also skeptical about your max_fsm_relations setting. This should be
> > equal to at least the number of rows output by \d in psql plus 100. Any
> > less and I question if your vacuum is being as effective as it should
> > be.
>
> sorry to sound dumb here ... but \d in psql gives me just 510 rows? I was
> going to crank it up to 1 million (originally it had been set at 64,000)
>
what your cranking up to 1 million is max_fsm_pages, what I'm talking
about is max_fsm_relations. _pages determines the total number of pages
of free space the database is willing to track, _relations determines
the total number of "objects" the database is willing to pay attention
to. The default is set to 100, which means if you have more than 100
tables/indicies in your database, vacuum might ignore some tables that
are being updated. Theres no rule on how it picks which tables it pays
attention to (my guess is that its a first come first served thing, but
thats just a guess) but given that there are around 90 system "objects"
it's not hard to imagine that some things get left behind. You probably
need this set to at least 610, though fwiw the default on this was
recently bumped up to 1000 for future versions.
Robert Treat
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: xzilla@users.sourceforge.net, htlevine@ebates.com
Subject: Re: max_fsm_pages Sanity Check
In-Reply-To: <1041605057.1983.32.camel@camel>
References: <1041547656.32015.38.camel@camel> <av2kmh$1ujh$1@news.hub.org> <1041605057.1983.32.camel@camel>
* 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