aboutsummaryrefslogtreecommitdiff
path: root/src/backend/access/heap/heapam_visibility.c
diff options
context:
space:
mode:
authorAlvaro Herrera <alvherre@alvh.no-ip.org>2020-10-15 14:32:34 -0300
committerAlvaro Herrera <alvherre@alvh.no-ip.org>2020-10-15 14:32:34 -0300
commit85adb5e91ec2f45a388bef7a92a3d988c7e45501 (patch)
tree1016833115e7e87ffff759fe2ba8ffce7c78a7a2 /src/backend/access/heap/heapam_visibility.c
parent2203ede9ae85b6423f850466122606275ea09b17 (diff)
downloadpostgresql-85adb5e91ec2f45a388bef7a92a3d988c7e45501.tar.gz
postgresql-85adb5e91ec2f45a388bef7a92a3d988c7e45501.zip
Remove pointless HeapTupleHeaderIndicatesMovedPartitions calls
Pavan Deolasee recently noted that a few of the HeapTupleHeaderIndicatesMovedPartitions calls added by commit 5db6df0c0117 are useless, since they are done after comparing t_self with t_ctid. But because t_self can never be set to the magical values that indicate that the tuple moved partition, this can never succeed: if the first test fails (so we know t_self equals t_ctid), necessarily the second test will also fail. So these checks can be removed and no harm is done. Discussion: https://postgr.es/m/20200929164411.GA15497@alvherre.pgsql
Diffstat (limited to 'src/backend/access/heap/heapam_visibility.c')
-rw-r--r--src/backend/access/heap/heapam_visibility.c9
1 files changed, 3 insertions, 6 deletions
diff --git a/src/backend/access/heap/heapam_visibility.c b/src/backend/access/heap/heapam_visibility.c
index 80bd4940769..cab6a48a5da 100644
--- a/src/backend/access/heap/heapam_visibility.c
+++ b/src/backend/access/heap/heapam_visibility.c
@@ -607,8 +607,7 @@ HeapTupleSatisfiesUpdate(HeapTuple htup, CommandId curcid,
{
if (HEAP_XMAX_IS_LOCKED_ONLY(tuple->t_infomask))
return TM_Ok;
- if (!ItemPointerEquals(&htup->t_self, &tuple->t_ctid) ||
- HeapTupleHeaderIndicatesMovedPartitions(tuple))
+ if (!ItemPointerEquals(&htup->t_self, &tuple->t_ctid))
return TM_Updated; /* updated by other */
else
return TM_Deleted; /* deleted by other */
@@ -653,8 +652,7 @@ HeapTupleSatisfiesUpdate(HeapTuple htup, CommandId curcid,
if (TransactionIdDidCommit(xmax))
{
- if (!ItemPointerEquals(&htup->t_self, &tuple->t_ctid) ||
- HeapTupleHeaderIndicatesMovedPartitions(tuple))
+ if (!ItemPointerEquals(&htup->t_self, &tuple->t_ctid))
return TM_Updated;
else
return TM_Deleted;
@@ -714,8 +712,7 @@ HeapTupleSatisfiesUpdate(HeapTuple htup, CommandId curcid,
SetHintBits(tuple, buffer, HEAP_XMAX_COMMITTED,
HeapTupleHeaderGetRawXmax(tuple));
- if (!ItemPointerEquals(&htup->t_self, &tuple->t_ctid) ||
- HeapTupleHeaderIndicatesMovedPartitions(tuple))
+ if (!ItemPointerEquals(&htup->t_self, &tuple->t_ctid))
return TM_Updated; /* updated by other */
else
return TM_Deleted; /* deleted by other */