Re: Why BgWriterDelay is fixed?

Поиск
Список
Период
Сортировка
От Jeff Janes
Тема Re: Why BgWriterDelay is fixed?
Дата
Msg-id CAMkU=1z66t9oV9OBb2D1NYxW355SYgr0Q3Qp-VXhVYZGqW923A@mail.gmail.com
обсуждение исходный текст
Ответ на Why BgWriterDelay is fixed?  (高健 <luckyjackgao@gmail.com>)
Ответы Re: Why BgWriterDelay is fixed?  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-general
On Mon, Oct 29, 2012 at 12:17 AM, 高健 <luckyjackgao@gmail.com> wrote:
> In src/backend/postmaster/bgwriter.c , I can find the following source
> code(PostgreSQL9.2):
>
>
> /*
>  * GUC parameters
>  */
> int BgWriterDelay = 200;

The value hard coded into the C code is the starting value, or
default.  It is not a constant.

Indeed, I don't think that value is even used.  I think that upon
start-up, that value gets set to the default listed in the guc.c file
(which is also 200), and so the value listed in the bgwriter.c file is
merely a mnemonic to remind people editing the file what the default
value is.


> But according to the fixed code of  BgWriterDelay = 200, even when I update
> bgwriter_delay in postgresql.conf to a different value(eg 300ms),
> how can it ovewrite the fixed  200ms in bgwriter.c ?

Doing so is the job of the "grand unified configuration" machinery, in
src/backend/utils/misc/guc.c



Cheers,

Jeff


В списке pgsql-general по дате отправления:

Предыдущее
От: Chris Angelico
Дата:
Сообщение: Re: How to print application_name in log_line_prefix (using %a)?
Следующее
От: Tom Lane
Дата:
Сообщение: Re: How to print application_name in log_line_prefix (using %a)?