Re: autovacuum_work_mem

From: Robert Haas <robertmhaas(at)gmail(dot)com>
To: Magnus Hagander <magnus(at)hagander(dot)net>
Cc: Peter Geoghegan <pg(at)heroku(dot)com>, Pg Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: autovacuum_work_mem
Date: 2013-12-11 13:50:22
Message-ID: CA+TgmoYAptVT=p8SNcF-XMKA7YgdqhpKD9yhrku8MtR5zztxUQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Sun, Oct 20, 2013 at 7:21 AM, Magnus Hagander <magnus(at)hagander(dot)net> wrote:
>> It seemed neater to me to create a new flag, so that in principle any
>> vacuum() code path can request autovacuum_work_mem, rather than having
>> lazyvacuum.c code call IsAutoVacuumWorkerProcess() for the same
>> purpose. To date, that's only been done within vacuumlazy.c for things
>> like logging.
>
> Hmm. I'm not entirely sure I agree that that makes it neater :)
>
> We could also look at autovacuum_vacuum_cost_limit etc above, but
> those just override what the non-autovac parameters do. But since the
> parameter is called maintenance_work_mem in that case, I think that
> would make it harder to read.
>
> But I'd suggest just a:
> int vac_work_mem = (IsAutoVacuumWorkerProcess() && autovacuum_work_mem
> != -1) ? autovacuum_work_mem : maintenance_work_mem;
>
> and not sending around a boolean flag through a bunch of places when
> it really means just the same thing,

+1 for that change.

--
Robert Haas
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Robert Haas 2013-12-11 13:56:43 Re: -d option for pg_isready is broken
Previous Message Fujii Masao 2013-12-11 13:45:57 Re: -d option for pg_isready is broken