Re: Speedup twophase transactions
Simon Riggs <simon@2ndquadrant.com>
From: Simon Riggs <simon@2ndQuadrant.com>
To: Andres Freund <andres@anarazel.de>
Cc: Simon Riggs <simon@2ndquadrant.com>,
Stas Kelvich <s.kelvich@postgrespro.ru>,
Alvaro Herrera <alvherre@2ndquadrant.com>,
pgsql-hackers <pgsql-hackers@postgresql.org>
Date: 2016-01-11T19:39:14Z
Lists: pgsql-hackers
On 11 January 2016 at 19:18, Andres Freund <andres@anarazel.de> wrote: > > More generally, I'm doubtful that the approach of reading data from WAL > > > as proposed here is a very good idea. It seems better to "just" dump > the > > > entire 2pc state into *one* file at checkpoint time. > > > > > > > I think you misunderstand the proposed approach. This isn't just to do > > with reading things back at checkpoint. > > Sure, the main purpose is not to write 2pc state files in the common > path - or is that not the main purpose? > Yes, that is the main purpose, but that's not what you were talking about. Currently, the patch reuses all of the code related to reading/write state files, so it is the minimal patch that can implement the important things for performance. The current patch succeeds in its goal to improve performance, so I personally see no further need for code churn. As you suggest, we could also completely redesign the state file mechanism and/or put it in WAL at checkpoint. That's all very nice but is much more code and doesn't anything more for performance, since the current mainline path writes ZERO files at checkpoint. If you want that for some other reason or refactoring, I won't stop you, but its a separate patch for a separate purpose. -- Simon Riggs http://www.2ndQuadrant.com/ <http://www.2ndquadrant.com/> PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services
Commits
-
Speedup 2PC recovery by skipping two phase state files in normal path
- 728bd991c3c4 10.0 landed
-
Add tests for two-phase commit
- 30820982b295 10.0 landed
-
Improve grammar of message about two-phase state files.
- 38c363adf497 10.0 landed
-
Speedup 2PC by skipping two phase state files in normal path
- 978b2f65aa12 9.6.0 cited