Re: Per-tablespace autovacuum settings

From: Oleksii Kliukin <alexk(at)hintbits(dot)com>
To: Robert Haas <robertmhaas(at)gmail(dot)com>
Cc: PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Chris Travers <chris(dot)travers(at)adjust(dot)com>
Subject: Re: Per-tablespace autovacuum settings
Date: 2019-05-06 15:02:09
Message-ID: 9DB1BADF-B204-4D0F-A277-EF6A6B261147@hintbits.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Robert Haas <robertmhaas(at)gmail(dot)com> wrote:

> On Thu, Apr 25, 2019 at 12:36 PM Oleksii Kliukin <alexk(at)hintbits(dot)com> wrote:
>> - Fallbacks to autovacuum parameters in another scope. Right now in the
>> absence of the per-table and per-tablespace autovacuum parameters the code
>> uses the ones from the global scope. However, if only some of the reloptions
>> are set on a per-table level (i.e. none of the autovacuum related ones), we
>> assume defaults for the rest of reloptions without consulting the lower
>> level (i.e .per-tablespace options). This is so because we don’t have the
>> mechanism to tell whether the option is set to its default value (some of
>> them use -1 to request the fallback to the outer level, but for some it’s
>> not possible, i.e. autovacuum_enabled is just a boolean value).
>
> That sounds like it's probably not acceptable?

Yes, I think it would be inconsistent. However, it looks like all the
options from AutoVacOpts other than autovacuum_enabled are set to -1 by
default. This can be used to tell whether the option is set to its default
value. For autovacuum_enabled we don’t care much: it’s true by default and
it’s a safe choice (even if the global autovacuum is off, enabling per-table
or per-tablespace one is a no-op).

I will update the patch.

Cheers,
Oleksii

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2019-05-06 15:03:54 Re: Unhappy about API changes in the no-fsm-for-small-rels patch
Previous Message Andres Freund 2019-05-06 14:58:36 Re: Unhappy about API changes in the no-fsm-for-small-rels patch