On Tue, 2008-05-27 at 20:35 +0100, Simon Riggs wrote: > My proposal is to have this as a two-stage process. When we set the hint > on a tuple in a clean buffer we mark it BM_DIRTY_HINTONLY, if not > already dirty. If we set a hint on a buffer that is BM_DIRTY_HINTONLY > then we mark it BM_DIRTY.
I would suggest calling that something like BM_DIRTY_ONEHINT or something, to more accurately reflect what's happening. Even when we do mark it several times, why do we need to actually mark it BM_DIRTY? We can then mark it BM_DIRTY_HINTSONLY, and then use some heuristics to determine whether we actually want to write it. For instance, we don't need to write out such a page during checkpoint, right? That might help smooth things out. Or during heavy I/O activity in general, for that matter. If it's only a hint, then that means we have the option. We might as well express the fact that it is optional to something better able to make the decision, like the process evicting the buffer or the bgwriter. Regards, Jeff Davis -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers