Skip to content

Commit 3154177

Browse files
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.
1 parent f66e7ab commit 3154177

File tree

1 file changed

+4
-2
lines changed
  • src/backend/access/transam

1 file changed

+4
-2
lines changed

src/backend/access/transam/xact.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4629,9 +4629,11 @@ xact_redo_commit_internal(TransactionId xid, XLogRecPtr lsn,
46294629
/*
46304630
* Release locks, if any. We do this for both two phase and normal one
46314631
* phase transactions. In effect we are ignoring the prepare phase and
4632-
* just going straight to lock release.
4632+
* just going straight to lock release. At commit we release all locks
4633+
* via their top-level xid only, so no need to provide subxact list,
4634+
* which will save time when replaying commits.
46334635
*/
4634-
StandbyReleaseLockTree(xid, nsubxacts, sub_xids);
4636+
StandbyReleaseLockTree(xid, 0, NULL);
46354637
}
46364638

46374639
/* Make sure files supposed to be dropped are dropped */

0 commit comments

Comments
 (0)