mirror of
https://github.com/postgres/postgres.git
synced 2025-05-05 09:19:17 +03:00
Add fast paths for cases when no serializable transactions are running.
Dan Ports
This commit is contained in:
parent
97e8346851
commit
02e6a115cc
@ -2275,6 +2275,18 @@ PredicateLockTupleRowVersionLink(const Relation relation,
|
|||||||
TransactionId oldxmin,
|
TransactionId oldxmin,
|
||||||
newxmin;
|
newxmin;
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Bail out quickly if there are no serializable transactions
|
||||||
|
* running.
|
||||||
|
*
|
||||||
|
* It's safe to do this check without taking any additional
|
||||||
|
* locks. Even if a serializable transaction starts concurrently,
|
||||||
|
* we know it can't take any SIREAD locks on the modified tuple
|
||||||
|
* because the caller is holding the associated buffer page lock.
|
||||||
|
*/
|
||||||
|
if (!TransactionIdIsValid(PredXact->SxactGlobalXmin))
|
||||||
|
return;
|
||||||
|
|
||||||
oldblk = ItemPointerGetBlockNumber(&(oldTuple->t_self));
|
oldblk = ItemPointerGetBlockNumber(&(oldTuple->t_self));
|
||||||
oldoff = ItemPointerGetOffsetNumber(&(oldTuple->t_self));
|
oldoff = ItemPointerGetOffsetNumber(&(oldTuple->t_self));
|
||||||
oldxmin = HeapTupleHeaderGetXmin(oldTuple->t_data);
|
oldxmin = HeapTupleHeaderGetXmin(oldTuple->t_data);
|
||||||
@ -2633,6 +2645,15 @@ PredicateLockPageSplit(const Relation relation, const BlockNumber oldblkno,
|
|||||||
PREDICATELOCKTARGETTAG newtargettag;
|
PREDICATELOCKTARGETTAG newtargettag;
|
||||||
bool success;
|
bool success;
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Bail out quickly if there are no serializable transactions
|
||||||
|
* running. As with PredicateLockTupleRowVersionLink, it's safe to
|
||||||
|
* check this without taking locks because the caller is holding
|
||||||
|
* the buffer page lock.
|
||||||
|
*/
|
||||||
|
if (!TransactionIdIsValid(PredXact->SxactGlobalXmin))
|
||||||
|
return;
|
||||||
|
|
||||||
if (SkipSplitTracking(relation))
|
if (SkipSplitTracking(relation))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user