pgsql: Speedup 2PC by skipping two phase state files in normal path

From: Simon Riggs <simon(at)2ndQuadrant(dot)com>
To: pgsql-committers(at)postgresql(dot)org
Subject: pgsql: Speedup 2PC by skipping two phase state files in normal path
Date: 2016-01-21 02:40:58
Message-ID: E1aM5BC-0001Fr-MB@gemulon.postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers

Speedup 2PC by skipping two phase state files in normal path

2PC state info is written only to WAL at PREPARE, then read back from WAL at
COMMIT PREPARED/ABORT PREPARED. Prepared transactions that live past one bufmgr
checkpoint cycle will be written to disk in the same form as previously. Crash
recovery path is not altered. Measured performance gains of 50-100% for short
2PC transactions by completely avoiding writing files and fsyncing. Other
optimizations still available, further patches in related areas expected.

Stas Kelvich and heavily edited by Simon Riggs

Based upon earlier ideas and patches by Michael Paquier and Heikki Linnakangas,
a concrete example of how Postgres-XC has fed back ideas into PostgreSQL.

Reviewed by Michael Paquier, Jeff Janes and Andres Freund
Performance testing by Jesper Pedersen

Branch
------
master

Details
-------
http://git.postgresql.org/pg/commitdiff/978b2f65aa1262eb4ecbf8b3785cb1b9cf4db78e

Modified Files
--------------
src/backend/access/transam/twophase.c | 377 ++++++++++++++-------------------
src/backend/access/transam/xlog.c | 3 +-
src/include/access/xlog.h | 1 +
3 files changed, 160 insertions(+), 221 deletions(-)

Browse pgsql-committers by date

  From Date Subject
Next Message Simon Riggs 2016-01-21 02:52:21 pgsql: Refactor headers to split out standby defs
Previous Message Peter Eisentraut 2016-01-21 02:31:13 pgsql: psql: Add tab completion for COPY with query