Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit695c597

Browse files
committed
Optimize TransactionIdIsCurrentTransactionId().
If the passed in xid is the current top transaction, we can do a fastcheck and exit early. This should work well for the current heap butalso works very well for proposed AMs that don't use a separate xidfor subtransactions.Author: Ashwin Agrawal, based on a suggestion from Andres FreundReviewed-by: Thomas MunroDiscussion:https://postgr.es/m/CALfoeiv0k3hkEb3Oqk%3DziWqtyk2Jys1UOK5hwRBNeANT_yX%2Bng%40mail.gmail.com
1 parent9fab25c commit695c597

File tree

1 file changed

+3
-0
lines changed
  • src/backend/access/transam

1 file changed

+3
-0
lines changed

‎src/backend/access/transam/xact.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -871,6 +871,9 @@ TransactionIdIsCurrentTransactionId(TransactionId xid)
871871
if (!TransactionIdIsNormal(xid))
872872
return false;
873873

874+
if (TransactionIdEquals(xid,GetTopTransactionIdIfAny()))
875+
return true;
876+
874877
/*
875878
* In parallel workers, the XIDs we must consider as current are stored in
876879
* ParallelCurrentXids rather than the transaction-state stack. Note that

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp