public inbox for [email protected]  
help / color / mirror / Atom feed
From: Peter Geoghegan <[email protected]>
To: Siddharth Kothari <[email protected]>
Cc: [email protected]
Cc: Vaibhav Jain <[email protected]>
Cc: Madhukar <[email protected]>
Cc: Xun Cheng <[email protected]>
Subject: Re: Fix size estimation for parallel B-Tree scans with skip arrays
Date: Wed, 29 Apr 2026 10:43:47 -0400
Message-ID: <CAH2-Wzk6-mzP4utr9=sKT9XQi+NgonD_X30z1sf_hgnKQvPpGg@mail.gmail.com> (raw)
In-Reply-To: <CAGCUe0Lwk3C0qdkBa+OLpYc7yXwW=pbaz8Sju4xMXEQAmyp+5g@mail.gmail.com>
References: <CAGCUe0Lwk3C0qdkBa+OLpYc7yXwW=pbaz8Sju4xMXEQAmyp+5g@mail.gmail.com>

On Wed, Apr 29, 2026 at 2:54 AM Siddharth Kothari <[email protected]> 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






reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: [email protected]
  Cc: [email protected], [email protected], [email protected], [email protected], [email protected], [email protected]
  Subject: Re: Fix size estimation for parallel B-Tree scans with skip arrays
  In-Reply-To: <CAH2-Wzk6-mzP4utr9=sKT9XQi+NgonD_X30z1sf_hgnKQvPpGg@mail.gmail.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox