On 29 October 2012 07:17, 高健 <luckyjackgao@xxxxxxxxx> wrote: > But I also found the following in postgresql.conf: > #bgwriter_delay = 200ms # 10-10000ms between rounds > It is now comment . > 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 ? That value is just a default, that we initialise the variable to as a sort of a reminder. We do this all over the place. Setting bgwriter_delay downwards will alter the frequency of iterations. The WaitLatch() thing is purely concerned with keeping the number of wake-ups low. As long as your database server does not idle, the logic is effectively exactly the same as what you'll see in 9.1, where the event loop is much simpler, and merely sleeps exactly bgwriter_delay ms every iteration. -- Peter Geoghegan http://www.2ndQuadrant.com/ PostgreSQL Development, 24x7 Support, Training and Services -- Sent via pgsql-general mailing list (pgsql-general@xxxxxxxxxxxxxx) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-general