1
0
mirror of https://github.com/postgres/postgres.git synced 2025-07-17 06:41:09 +03:00

Optimize commit_siblings in two ways to improve group commit.

First, avoid scanning the whole ProcArray once we know there
are at least commit_siblings active; second, skip the check
altogether if commit_siblings = 0.

Greg Smith
This commit is contained in:
Simon Riggs
2010-12-08 18:48:03 +00:00
parent 5a031a5556
commit e620ee35b2
5 changed files with 27 additions and 13 deletions

View File

@ -1052,7 +1052,7 @@ RecordTransactionCommit(void)
* fewer than CommitSiblings other backends with active transactions.
*/
if (CommitDelay > 0 && enableFsync &&
CountActiveBackends() >= CommitSiblings)
MinimumActiveBackends(CommitSiblings))
pg_usleep(CommitDelay);
XLogFlush(XactLastRecEnd);