| From: | Siddharth Kothari <sidkot(at)google(dot)com> |
|---|---|
| To: | Peter Geoghegan <pg(at)bowt(dot)ie> |
| Cc: | pgsql-bugs(at)lists(dot)postgresql(dot)org, Vaibhav Jain <jainva(at)google(dot)com>, Madhukar <madhukarprasad(at)google(dot)com>, Xun Cheng <xuncheng(at)google(dot)com> |
| Subject: | Re: Fix size estimation for parallel B-Tree scans with skip arrays |
| Date: | 2026-04-29 14:59:23 |
| Message-ID: | CAGCUe0L+M113dXmW44LWDmqSHa8kMcwAKgW+hXdTwVd-8dz8jA@mail.gmail.com |
| Views: | Whole Thread | Raw Message | Download mbox | Resend email |
| Thread: | |
| Lists: | pgsql-bugs |
Thank you Peter!
On Wed, Apr 29, 2026 at 8:14 PM Peter Geoghegan <pg(at)bowt(dot)ie> wrote:
> On Wed, Apr 29, 2026 at 2:54 AM Siddharth Kothari <sidkot(at)google(dot)com>
> wrote:
> > Root cause:
> >
> > In src/backend/access/nbtree/nbtree.c, the loop in
> btestimateparallelscan assumes that every index column might require a skip
> array and adds sizeof(int) to the estimated size:
> >
> > However, every skip array actually needs space for its slot in the
> btps_arrElems array AND space to store its scan key's sk_flags.
>
> Your diagnosis looks correct to me. As you said, the problem is that
> we only add btps_arrElems space overhead for input scan keys -- we
> neglect to do the same for any skip array scan key that might be
> output by nbtree preprocessing later on.
>
> I'll commit this patch later today.
>
> Thanks!
> --
> Peter Geoghegan
>
| From | Date | Subject | |
|---|---|---|---|
| Next Message | Tomas Vondra | 2026-04-29 15:42:55 | Re: Fix size estimation for parallel B-Tree scans with skip arrays |
| Previous Message | Peter Geoghegan | 2026-04-29 14:43:47 | Re: Fix size estimation for parallel B-Tree scans with skip arrays |