diff options
author | Simon Riggs <simon@2ndQuadrant.com> | 2012-11-13 16:12:20 -0300 |
---|---|---|
committer | Simon Riggs <simon@2ndQuadrant.com> | 2012-11-13 16:12:20 -0300 |
commit | 31541778b612fd59257a2bf571229f400d35ecf0 (patch) | |
tree | e8726529caada7718d6ed172d1ff70cc259e49c9 /src/backend/access/transam | |
parent | f66e7ab6db30b7893493c4dfd5d642bef93b350f (diff) | |
download | postgresql-31541778b612fd59257a2bf571229f400d35ecf0.tar.gz postgresql-31541778b612fd59257a2bf571229f400d35ecf0.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/backend/access/transam')
-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 5f85fe20116..58bb28177d4 100644 --- a/src/backend/access/transam/xact.c +++ b/src/backend/access/transam/xact.c @@ -4629,9 +4629,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 */ |