summaryrefslogtreecommitdiff
path: root/src/backend/commands/vacuum.c
diff options
context:
space:
mode:
authorNoah Misch2024-04-29 17:25:33 +0000
committerNoah Misch2024-04-29 17:25:33 +0000
commitdd0183469bb779247c96e86c2272dca7ff4ec9e7 (patch)
tree1e2998dec368e7476dde36894e2b7f4356308f12 /src/backend/commands/vacuum.c
parentf65ab862e3b8d96c6886641155d9447bc73b5126 (diff)
Avoid repeating loads of frozen ID values.
Repeating loads of inplace-updated fields tends to cause bugs like the one from the previous commit. While there's no bug to fix in these code sites, adopt the load-once style. This improves the chance of future copy/paste finding the safe style. Discussion: https://postgr.es/m/[email protected]
Diffstat (limited to 'src/backend/commands/vacuum.c')
-rw-r--r--src/backend/commands/vacuum.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/backend/commands/vacuum.c b/src/backend/commands/vacuum.c
index a63a71c984d..521ee74586a 100644
--- a/src/backend/commands/vacuum.c
+++ b/src/backend/commands/vacuum.c
@@ -1200,7 +1200,7 @@ vacuum_get_cutoffs(Relation rel, const VacuumParams *params,
aggressiveXIDCutoff = nextXID - freeze_table_age;
if (!TransactionIdIsNormal(aggressiveXIDCutoff))
aggressiveXIDCutoff = FirstNormalTransactionId;
- if (TransactionIdPrecedesOrEquals(rel->rd_rel->relfrozenxid,
+ if (TransactionIdPrecedesOrEquals(cutoffs->relfrozenxid,
aggressiveXIDCutoff))
return true;
@@ -1221,7 +1221,7 @@ vacuum_get_cutoffs(Relation rel, const VacuumParams *params,
aggressiveMXIDCutoff = nextMXID - multixact_freeze_table_age;
if (aggressiveMXIDCutoff < FirstMultiXactId)
aggressiveMXIDCutoff = FirstMultiXactId;
- if (MultiXactIdPrecedesOrEquals(rel->rd_rel->relminmxid,
+ if (MultiXactIdPrecedesOrEquals(cutoffs->relminmxid,
aggressiveMXIDCutoff))
return true;