Re: Add bms_offset_members() function for bitshifting Bitmapsets - Mailing list pgsql-hackers

From David Rowley
Subject Re: Add bms_offset_members() function for bitshifting Bitmapsets
Date
Msg-id CAApHDvqPRUqTVU0=Ewm38UKWOV5Ak1mQXg=+L98Mm9CVpyAmLQ@mail.gmail.com
Whole thread
In response to Re: Add bms_offset_members() function for bitshifting Bitmapsets  ("Greg Burd" <greg@burd.me>)
List pgsql-hackers
On Tue, 21 Apr 2026 at 02:55, Greg Burd <greg@burd.me> wrote:
> Were you planning on writing the optimized non-copy version as well?  I don't think it is strictly necessary, more a
curiosity.
>
> bms_offset_members() -> new bms, might repalloc() replaces existing loops you've found
> bms_shift_members() -> bms is modified in place and fits your new use case a bit better

Not at this stage. The v1 patch did modify the set in-place, so the
code is there if we ever need it. I didn't find any need for it in our
current code. The selective tuple deforming patch I'm working on could
use it, but I doubt it's worth the trouble for 1 caller. It's just for
something that happens during create_plan(), so 1 more allocation in
that code likely isn't going to be noticed.

David



pgsql-hackers by date:

Previous
From: Henson Choi
Date:
Subject: Re: Experimenting with wider Unicode storage
Next
From: Chao Li
Date:
Subject: logical: fix recomputation required LSN on restart_lsn-only advancement