diff options
author | Simon Riggs <simon@2ndQuadrant.com> | 2012-11-13 16:00:19 -0300 |
---|---|---|
committer | Simon Riggs <simon@2ndQuadrant.com> | 2012-11-13 16:00:19 -0300 |
commit | d9fad1076da4f3686b16e7c9f137118a3156a43a (patch) | |
tree | 7d323bce5e7d4ad75f56c2d6ed879f3329a49589 /src | |
parent | 68f7fe140bebc2b9bd2953934539cedb603fd01b (diff) | |
download | postgresql-d9fad1076da4f3686b16e7c9f137118a3156a43a.tar.gz postgresql-d9fad1076da4f3686b16e7c9f137118a3156a43a.zip |
Skip searching for subxact locks at commit.
At commit all standby locks are released
for the top-level transaction, so searching
for locks for each subtransaction is both
pointless and costly (N^2) in the presence
of many AccessExclusiveLocks.
Diffstat (limited to 'src')
-rw-r--r-- | src/backend/access/transam/xact.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/backend/access/transam/xact.c b/src/backend/access/transam/xact.c index c24df3f38c2..10386dadce5 100644 --- a/src/backend/access/transam/xact.c +++ b/src/backend/access/transam/xact.c @@ -4609,9 +4609,11 @@ xact_redo_commit_internal(TransactionId xid, XLogRecPtr lsn, /* * Release locks, if any. We do this for both two phase and normal one * phase transactions. In effect we are ignoring the prepare phase and - * just going straight to lock release. + * just going straight to lock release. At commit we release all locks + * via their top-level xid only, so no need to provide subxact list, + * which will save time when replaying commits. */ - StandbyReleaseLockTree(xid, nsubxacts, sub_xids); + StandbyReleaseLockTree(xid, 0, NULL); } /* Make sure files supposed to be dropped are dropped */ |