2011/7/29 Greg Smith <g...@2ndquadrant.com>:
> 1) Postponing writes as long as possible always improves the resulting
> throughput of those writes.  Any incremental checkpoint approach will detune
> throughput by some amount.  If you make writes go out more often, they will
> be less efficient; that's just how things work if you benchmark anything
> that allows write combining.  Any incremental checkpoint approach is likely
> to improve latency in some cases if it works well, while decreasing
> throughput in most cases.

Agreed.  I came to the same conclusion a while back and then got
depressed.  That might mean we need a parameter to control the
behavior, unless we can find a change where the throughput drop is
sufficiently small that we don't really care, or make the optimization
apply only in cases where we determine that the latency problem will
be so severe that we'll certainly be willing to accept a drop in
throughput to avoid it.

> 2) The incremental checkpoint approach used by other databases, such as the
> MySQL implementation, works by tracking what transaction IDs were associated
> with a buffer update.  The current way PostgreSQL saves buffer sync
> information for the checkpoint to process things doesn't store enough
> information to do that.  As you say, the main price there is some additional
> memory.

I think what we'd need to track is the LSN that first dirtied the page
(as opposed to the current field, which tracks the LSN that most
recently wrote the page).  If we write and flush all pages whose
first-dirtied LSN precedes some cutoff point, then we ought to be able
to advance the redo pointer to that point.

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

-- 
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers

Reply via email to