Re: Separating bgwriter and checkpointer
Robert Haas <robertmhaas@gmail.com>
From: Robert Haas <robertmhaas@gmail.com>
To: Heikki Linnakangas <heikki.linnakangas@enterprisedb.com>
Cc: Greg Stark <stark@mit.edu>, Simon Riggs <simon@2ndquadrant.com>, Fujii Masao <masao.fujii@gmail.com>, PostgreSQL-development <pgsql-hackers@postgresql.org>
Date: 2011-09-20T14:53:17Z
Lists: pgsql-hackers
On Tue, Sep 20, 2011 at 9:35 AM, Heikki Linnakangas <heikki.linnakangas@enterprisedb.com> wrote: >> All that said my question is which way is the code more legible and >> easier to follow? > > Hear hear. If we're going to give the bgwriter more responsibilities, this > might make sense even if it has no effect on performance. I agree. I don't think this change needs to be justified on performance grounds; there are enough collateral benefits to make it worthwhile. If the checkpoint process handles all the stuff with highly variable latency (i.e. fsyncs), then the background writer work will happen more regularly and predictably. The code will also be simpler, which I think will open up opportunities for additional optimizations such as (perhaps) making the background writer only wake up when there are dirty buffers to write, which ties in to longstanding concerns about power consumption. -- Robert Haas EnterpriseDB: http://www.enterprisedb.com The Enterprise PostgreSQL Company