Offering: openGaussDev

More detail: perf

Match-id-3e2076ba3cde3a1687d61ed5f0632e289fe6c654
This commit is contained in:
openGaussDev
2022-03-04 11:50:16 +08:00
committed by yanghao
parent 8191e214c6
commit 791b04f19c

View File

@ -5967,12 +5967,11 @@ int ExecCleanTargetListLength(List* targetlist)
return len; return len;
} }
HeapTuple get_tuple(Relation relation, ItemPointer tid, bool update_check) static HeapTuple get_tuple(Relation relation, ItemPointer tid)
{ {
Buffer user_buf = InvalidBuffer; Buffer user_buf = InvalidBuffer;
HeapTuple tuple = NULL; HeapTuple tuple = NULL;
HeapTuple new_tuple = NULL; HeapTuple new_tuple = NULL;
TM_Result result;
/* alloc mem for old tuple and set tuple id */ /* alloc mem for old tuple and set tuple id */
tuple = (HeapTupleData *)heaptup_alloc(BLCKSZ); tuple = (HeapTupleData *)heaptup_alloc(BLCKSZ);
@ -5981,11 +5980,6 @@ HeapTuple get_tuple(Relation relation, ItemPointer tid, bool update_check)
tuple->t_self = *tid; tuple->t_self = *tid;
if (heap_fetch(relation, SnapshotAny, tuple, &user_buf, false, NULL)) { if (heap_fetch(relation, SnapshotAny, tuple, &user_buf, false, NULL)) {
result = update_check ? HeapTupleSatisfiesUpdate(tuple, GetCurrentCommandId(true), user_buf, false) : TM_Ok;
if (result != TM_Ok) {
ereport(ERROR, (errcode(ERRCODE_SYSTEM_ERROR), errmsg("Failed to get tuple")));
}
new_tuple = heapCopyTuple((HeapTuple)tuple, relation->rd_att, NULL); new_tuple = heapCopyTuple((HeapTuple)tuple, relation->rd_att, NULL);
ReleaseBuffer(user_buf); ReleaseBuffer(user_buf);
} else { } else {
@ -6013,7 +6007,7 @@ Datum fetch_lob_value_from_tuple(varatt_lob_pointer* lob_pointer, Oid update_oid
tuple_ctid.ip_blkid.bi_lo = lob_pointer->bi_lo; tuple_ctid.ip_blkid.bi_lo = lob_pointer->bi_lo;
tuple_ctid.ip_posid = lob_pointer->ip_posid; tuple_ctid.ip_posid = lob_pointer->ip_posid;
Relation relation = heap_open(lob_pointer->relid, RowExclusiveLock); Relation relation = heap_open(lob_pointer->relid, RowExclusiveLock);
HeapTuple origin_tuple = get_tuple(relation, &tuple_ctid, false); HeapTuple origin_tuple = get_tuple(relation, &tuple_ctid);
if (!HeapTupleIsValid(origin_tuple)) { if (!HeapTupleIsValid(origin_tuple)) {
ereport(ERROR, ereport(ERROR,
(errcode(ERRCODE_CACHE_LOOKUP_FAILED), (errcode(ERRCODE_CACHE_LOOKUP_FAILED),