Re: Berserk Autovacuum (let's save next Mandrill) - Mailing list pgsql-hackers

From Justin Pryzby
Subject Re: Berserk Autovacuum (let's save next Mandrill)
Date
Msg-id 20200325150656.GX21443@telsasoft.com
Whole thread Raw
In response to Re: Berserk Autovacuum (let's save next Mandrill)  (Laurenz Albe <laurenz.albe@cybertec.at>)
Responses Re: Berserk Autovacuum (let's save next Mandrill)  (Alvaro Herrera <alvherre@2ndquadrant.com>)
List pgsql-hackers
On Mon, Mar 23, 2020 at 02:27:29PM +0100, Laurenz Albe wrote:
> Here is version 10 of the patch, which uses a scale factor of 0.2.

Thanks

> Any table that has received more inserts since it was
> last vacuumed (and that is not vacuumed for another
> reason) will be autovacuumed.

Since this vacuum doesn't trigger any special behavior (freeze), you can remove
the parenthesized part: "(and that is not vacuumed for another reason)".

Maybe in the docs you can write this with thousands separators: 10,000,000

It looks like the GUC uses scale factor max=1e10, but the relopt is still
max=100, which means it's less possible to disable for a single rel.

> +++ b/src/backend/access/common/reloptions.c
> @@ -398,6 +407,15 @@ static relopt_real realRelOpts[] =
>          },
>          -1, 0.0, 100.0
>      },
> +    {
> +        {
> +            "autovacuum_vacuum_insert_scale_factor",
> +            "Number of tuple inserts prior to vacuum as a fraction of reltuples",
> +            RELOPT_KIND_HEAP | RELOPT_KIND_TOAST,
> +            ShareUpdateExclusiveLock
> +        },
> +        -1, 0.0, 100.0
> +    },
>      {
>          {
>              "autovacuum_analyze_scale_factor",

> +++ b/src/backend/utils/misc/guc.c
> @@ -3549,6 +3558,17 @@ static struct config_real ConfigureNamesReal[] =
>          0.2, 0.0, 100.0,
>          NULL, NULL, NULL
>      },
> +
> +    {
> +        {"autovacuum_vacuum_insert_scale_factor", PGC_SIGHUP, AUTOVACUUM,
> +            gettext_noop("Number of tuple inserts prior to vacuum as a fraction of reltuples."),
> +            NULL
> +        },
> +        &autovacuum_vac_ins_scale,
> +        0.2, 0.0, 1e10,
> +        NULL, NULL, NULL
> +    },
> +
>      {
>          {"autovacuum_analyze_scale_factor", PGC_SIGHUP, AUTOVACUUM,
>              gettext_noop("Number of tuple inserts, updates, or deletes prior to analyze as a fraction of
reltuples."),



pgsql-hackers by date:

Previous
From: David Steele
Date:
Subject: Re: [Patch] Invalid permission check in pg_stats for functionalindexes
Next
From: Andy Fan
Date:
Subject: Re: [PATCH] Erase the distinctClause if the result is unique by definition