enhance tuple lock

This commit is contained in:
chenxiaobin19
2021-12-16 20:37:27 +08:00
parent 2417964517
commit 899cd4a36c
92 changed files with 4402 additions and 1177 deletions

View File

@ -835,7 +835,8 @@ BitmapHeapScanState* ExecInitBitmapHeapScan(BitmapHeapScan* node, EState* estate
* occured after taking the snapshot. Skip for explain only commands.
*/
if (isUstoreRel && !(eflags & EXEC_FLAG_EXPLAIN_ONLY)) {
TransactionId relfrozenxid64 = getPartitionRelfrozenxid(partitiontrel);
TransactionId relfrozenxid64 = InvalidTransactionId;
getPartitionRelxids(partitiontrel, &relfrozenxid64);
if (TransactionIdPrecedes(FirstNormalTransactionId, scanSnap->xmax) &&
!TransactionIdIsCurrentTransactionId(relfrozenxid64) &&
TransactionIdPrecedes(scanSnap->xmax, relfrozenxid64)) {
@ -859,7 +860,8 @@ BitmapHeapScanState* ExecInitBitmapHeapScan(BitmapHeapScan* node, EState* estate
* occured after taking the snapshot. Skip for explain only commands.
*/
if (!(eflags & EXEC_FLAG_EXPLAIN_ONLY)) {
TransactionId relfrozenxid64 = getRelationRelfrozenxid(currentRelation);
TransactionId relfrozenxid64 = InvalidTransactionId;
getRelationRelxids(currentRelation, &relfrozenxid64);
if (TransactionIdPrecedes(FirstNormalTransactionId, scanSnap->xmax) &&
!TransactionIdIsCurrentTransactionId(relfrozenxid64) &&
TransactionIdPrecedes(scanSnap->xmax, relfrozenxid64)) {