Possible incorrect comment in ginget.c

From: Arseniy Mukhin <arseniy(dot)mukhin(dot)dev(at)gmail(dot)com>
To: PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Possible incorrect comment in ginget.c
Date: 2025-04-24 09:53:16
Message-ID: CAE7r3MKdA68jZXFsbUfrfv-wzBURX+m5CNO71T8Qszbs6J8u2Q@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi,

I was a bit confused by this comment in keyGetItem() (ginget.c)

/*
* Normally, none of the items in additionalEntries can have a curItem
* larger than minItem. But if minItem is a lossy page, then there
* might be exact items on the same page among additionalEntries.
*/

AFAIS the code before the comment is opposite to the comment's first sentence.
We set advancePast right before the minItem, and if an additional
entry's curItem is smaller than or equals to advancePast, we call
entryGetItem(), so afterwards it should be larger than advancePast and
larger than or equal to minItem.
So it seems that normally all items in additionalEntries have a
curItem larger than or equal to minItem.

It seems the correct first sentence would be:
"Normally, none of the items in additionalEntries can have a curItem
LESS than minItem"

Best regards,
Arseniy Mukhin

Browse pgsql-hackers by date

  From Date Subject
Next Message Amit Kapila 2025-04-24 09:57:56 Re: Fix premature xmin advancement during fast forward decoding
Previous Message Ashutosh Bapat 2025-04-24 09:52:44 Re: Does RENAME TABLE rename associated identity sequence?