Re: [PATCHES] A way to let Vacuum warn if FSM settings are low.

From: Simon Riggs <simon(at)2ndquadrant(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Ron Mayer <rm_pg(at)cheapcomplexdevices(dot)com>, pgsql-general(at)postgresql(dot)org, pgsql-patches(at)postgresql(dot)org
Subject: Re: [PATCHES] A way to let Vacuum warn if FSM settings are low.
Date: 2005-02-24 13:24:51
Message-ID: 1109251491.20045.23.camel@localhost.localdomain
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general pgsql-patches

On Wed, 2005-02-23 at 19:31 -0500, Tom Lane wrote:
> Ron Mayer <rm_pg(at)cheapcomplexdevices(dot)com> writes:
> > + if (needed > MaxFSMPages)
> > + ereport(WARNING,
> > + (errmsg("max_fsm_pages(%d) is smaller than total pages needed(%.0f)",
> > + MaxFSMPages, needed)));
>
> An unconditional WARNING seems a bit strong to me for a case that is not
> necessarily wrong. Depending on the needs of the installation, this
> might be a perfectly acceptable situation --- for example if you have
> lots of large read-mostly tables.

The patch seems very useful to me. I had been thinking about doing
something like that myself.

VACUUM uses an INFO to provide the "total pages needed", so it should be
a simple matter to change the ereport to an INFO rather than WARNING as
well.

It would be great to have both lines of INFO, so that VACUUM would
produce output like this:

patched=# vacuum;
INFO: free space map: 77 relations, 470 pages stored
INFO: max_fsm_pages(1601) is smaller than total pages needed(2832)
DETAIL: Allocated FSM size: 100 relations + 1601 pages = 19 kB shared
memory.
VACUUM

...where the second info line was conditional...like this...

+ if (numRels == MaxFSMRelations)
+ ereport(WARNING,
+ (errmsg("max_fsm_relations(%d) may be set too low",
+ MaxFSMRelations)));
+ else
+ if (needed > MaxFSMPages)
+ ereport(INFO,
+ (errmsg("max_fsm_pages(%d) is smaller than total pages
needed(%.0f)",
+ MaxFSMPages, needed)));

ereport(elevel,
(errmsg("free space map: %d relations, %d pages stored;
%.0f total pages needed",

Which goes more towards Tom's gripes.

The manual could have a line added to explain that if max_fsm_relations
is set too low, then max_fsm_pages may also inadvertently be too low,
yet not be obvious that that is the case.

Best Regards, Simon Riggs

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Kai Hessing 2005-02-24 13:38:47 Re: Advanced SELECT
Previous Message Dave Cramer 2005-02-24 13:04:39 OT: looking for open source developers in ukraine, or Georgia Russia

Browse pgsql-patches by date

  From Date Subject
Next Message Tom Lane 2005-02-24 15:15:50 Re: invalid multibyte character for locale
Previous Message Christopher Kings-Lynne 2005-02-24 09:26:24 Re: [PATCHES] A way to let Vacuum warn if FSM settings are low.