On Wed, Apr 29, 2026 at 8:14 PM Peter Geoghegan <pg@bowt.ie> wrote:
On Wed, Apr 29, 2026 at 2:54 AM Siddharth Kothari <sidkot@google.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.