Skip to content

Commit 3293330

Browse files
committed
Fix comment on when HOT update is possible.
The conditions listed in this comment have changed several times, and at some point the thing that the "if so" referred to was negated. The text was OK up to 9.6. It was differently wrong in v10, v11 and master, so fix in all those versions.
1 parent 6bbc2f9 commit 3293330

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

src/backend/access/heap/heapam.c

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4217,11 +4217,10 @@ heap_update(Relation relation, ItemPointer otid, HeapTuple newtup,
42174217
{
42184218
/*
42194219
* Since the new tuple is going into the same page, we might be able
4220-
* to do a HOT update. Check if any of the index columns have been
4221-
* changed, or if we have projection functional indexes, check whether
4222-
* the old and the new values are the same. If the page was already
4223-
* full, we may have skipped checking for index columns. If so, HOT
4224-
* update is possible.
4220+
* to do a HOT update. A HOT update is possible if none of the index
4221+
* columns, nor columns used in projection functional indexes, have
4222+
* changed. If the page was already full, we may have skipped
4223+
* checking for index columns, and also can't do a HOT update.
42254224
*/
42264225
if (hot_attrs_checked
42274226
&& !bms_overlap(modified_attrs, hot_attrs)

0 commit comments

Comments
 (0)