Group commit in PostgreSQL

There are three active projects to add support for group commit to MySQL/InnoDB. Monty Program and MySQL appear to have work in progress. The Facebook version is done but we will gladly undo it when official versions are ready.


PostgreSQL has group commit today. It is enabled by the commit_delay configuration parameter and the feature is described in the manual.


The commit_delay options provides a constraint on when group commit is done that has yet to be considered in the MySQL implementations. When commit_siblings is set to a non-zero value then a transaction attempting to commit will only wait at least that many transactions are active. This is a great option because for workloads with limited or intermittent concurrency there is no reason to wait when it is unlikely that another commit will be attempted before the commit_delay time expires.


It is harder to implement group commit for MySQL/InnoDB because two resource managers must be kept in sync: InnoDB and the binlog. This looks a lot like XA. But that is required until someone implements storage-engine replication (which is another hard problem).


In PostgreSQL there is but one log to worry about, the WAL. That simplifies group commit, replication and incremental backup. But those are topics for another post or another author.