Re: Can rs_cindex be < 0 for bitmap heap scans?

From: Melanie Plageman <melanieplageman(at)gmail(dot)com>
To: Richard Guo <guofenglinux(at)gmail(dot)com>
Cc: Ranier Vilela <ranier(dot)vf(at)gmail(dot)com>, Dilip Kumar <dilipbalaut(at)gmail(dot)com>, Pg Hackers <pgsql-hackers(at)postgresql(dot)org>, Tomas Vondra <tv(at)fuzzy(dot)cz>, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Subject: Re: Can rs_cindex be < 0 for bitmap heap scans?
Date: 2024-12-20 14:45:47
Message-ID: CAAKRu_Y_-sXq3YfZuMAm11=rqAQceUCwhb5122Lo+tq01EZdPw@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Thu, Dec 19, 2024 at 9:36 PM Richard Guo <guofenglinux(at)gmail(dot)com> wrote:
>
> On Fri, Dec 20, 2024 at 7:50 AM Melanie Plageman
> <melanieplageman(at)gmail(dot)com> wrote:
> Looks correct to me.
>
> BTW, I kind of doubt that the overflow risk fixed in 28328ec87 is a
> real issue in real-world scenarios. Is it realistically possible to
> have more than INT_MAX tuples fit on one heap page?
>
> If it is, then the statement below could also be prone to overflow.
>
> uint32 mid = (start + end) / 2;
>
> Maybe you want to change it to:
>
> uint32 mid = start + (end - start) / 2;

I've done this and pushed.

Thanks to you and Ranier for your help in identifying and fixing this!

- Melanie

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2024-12-20 15:23:33 Re: pure parsers and reentrant scanners
Previous Message Peter Eisentraut 2024-12-20 14:29:40 Re: pure parsers and reentrant scanners