> On Dec 4, 2025, at 01:31, Peter Geoghegan <[email protected]> wrote:
> 
> 
> Note also that we'll use much less memory for killedItems by
> representing it as a Bitmapset. We'll use at most one bit per
> so->currPos.items[] item, whereas before we used 4 bytes per item.
> 

That’s true, BitmapSet saves 7/8 of memory usage for killedItems. However, it 
also brings a little performance burden, because bms_next_member() does O(N) 
iteration. Say so->curPos.items[] = {0, 1000}, the old code directly gives 0 
and 1000 to the “for” loop, but the new code needs to iterate over 999 bits to 
get next member 1000. Maybe that’s affordable.

Actually MaxTIDsPerBTreePage (max length of so->curPos.items[]) is a value 
around 1000, in the old code, killedItems could be “short *” instead of “int 
*”, which may also save a half of memory usage.

Best regards,
--
Chao Li (Evan)
HighGo Software Co., Ltd.
https://www.highgo.com/






Reply via email to