Re: A way to let Vacuum warn if FSM settings are low. - Mailing list pgsql-patches

From Tom Lane
Subject Re: A way to let Vacuum warn if FSM settings are low.
Date
Msg-id 23726.1109205065@sss.pgh.pa.us
Whole thread Raw
In response to A way to let Vacuum warn if FSM settings are low.  (Ron Mayer <rm_pg@cheapcomplexdevices.com>)
Responses Re: A way to let Vacuum warn if FSM settings are low.
List pgsql-patches
Ron Mayer <rm_pg@cheapcomplexdevices.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.

On the other side of the coin, the test could pass (ie no warning) in
situations where in fact MaxFSMPages is too small, because what we are
comparing it to is the number of pages requested for relations that are
being tracked.  If MaxFSMRelations is too small then we can't really
tell whether MaxFSMPages is adequate.

> +    if (numRels > MaxFSMRelations)
> +        ereport(WARNING,
> +            (errmsg("max_fsm_relations(%d) is smaller than the number of relations (%d)",
> +             MaxFSMRelations, numRels)));

This part is just plain dead code, since it's not possible for numRels
to exceed MaxFSMRelations.

I think it might be useful to warn when numRels == MaxFSMRelations,
since if you don't have even one spare fsmrel slot then you probably
have too few (it's unlikely you got it on the nose).  But I don't know
how to produce a warning about MaxFSMPages that's worth anything.

            regards, tom lane

pgsql-patches by date:

Previous
From: Ron Mayer
Date:
Subject: A way to let Vacuum warn if FSM settings are low.
Next
From: "John Hansen"
Date:
Subject: Re: optimize md5_text