Re: [BUG] false positive in bt_index_check in case of short 4B varlena datum

Andrey Borodin <x4mmm@yandex-team.ru>

From: Andrey Borodin <x4mmm@yandex-team.ru>
To: Michael Paquier <michael@paquier.xyz>
Cc: Alexander Korotkov <aekorotkov@gmail.com>, Andres Freund <andres@anarazel.de>, Alexander Lakhin <exclusion@gmail.com>, Michael Zhilin <m.zhilin@postgrespro.ru>, pgsql-bugs@postgresql.org, Yura Sokolov <y.sokolov@postgrespro.ru>
Date: 2026-05-12T09:17:27Z
Lists: pgsql-bugs

> On 9 May 2026, at 04:07, Michael Paquier <michael@paquier.xyz> wrote:
> 
> On Mon, May 04, 2026 at 10:20:04AM +0500, Andrey Borodin wrote:
>> However, I'd like to note that (VARSIZE_1B() < TOAST_INDEX_TARGET) is
>> constantly true for 8Kb+ pages.
> 
> How much slower?  I cannot imagine that it matters much in this code
> path, but you are getting me worried.


I think there will be no performance difference.

Change proposed by Alexander only prevents use of VARSIZE() against datum
that is VARSIZE_1B. AFAICS no actual behavior would change.

On some occasions we would have to normilize less tuples.


Best regards, Andrey Borodin.



Commits

Same data as JSON: GET /api/v1/messages/:b64id/commits the thread's linked commits as JSON, with link sources. API reference →
  1. amcheck: Use correct varlena size accessor in bt_normalize_tuple()