Commit d9fad107 authored by Simon Riggs's avatar Simon Riggs

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.
parent 68f7fe14
......@@ -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 */
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment