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

Commit02e6a11

Browse files
committed
Add fast paths for cases when no serializable transactions are running.
Dan Ports
1 parent97e8346 commit02e6a11

File tree

1 file changed

+21
-0
lines changed

1 file changed

+21
-0
lines changed

‎src/backend/storage/lmgr/predicate.c

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2275,6 +2275,18 @@ PredicateLockTupleRowVersionLink(const Relation relation,
22752275
TransactionIdoldxmin,
22762276
newxmin;
22772277

2278+
/*
2279+
* Bail out quickly if there are no serializable transactions
2280+
* running.
2281+
*
2282+
* It's safe to do this check without taking any additional
2283+
* locks. Even if a serializable transaction starts concurrently,
2284+
* we know it can't take any SIREAD locks on the modified tuple
2285+
* because the caller is holding the associated buffer page lock.
2286+
*/
2287+
if (!TransactionIdIsValid(PredXact->SxactGlobalXmin))
2288+
return;
2289+
22782290
oldblk=ItemPointerGetBlockNumber(&(oldTuple->t_self));
22792291
oldoff=ItemPointerGetOffsetNumber(&(oldTuple->t_self));
22802292
oldxmin=HeapTupleHeaderGetXmin(oldTuple->t_data);
@@ -2633,6 +2645,15 @@ PredicateLockPageSplit(const Relation relation, const BlockNumber oldblkno,
26332645
PREDICATELOCKTARGETTAGnewtargettag;
26342646
boolsuccess;
26352647

2648+
/*
2649+
* Bail out quickly if there are no serializable transactions
2650+
* running. As with PredicateLockTupleRowVersionLink, it's safe to
2651+
* check this without taking locks because the caller is holding
2652+
* the buffer page lock.
2653+
*/
2654+
if (!TransactionIdIsValid(PredXact->SxactGlobalXmin))
2655+
return;
2656+
26362657
if (SkipSplitTracking(relation))
26372658
return;
26382659

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp