Re: [PATCH] Add tests for Bitmapset - Mailing list pgsql-hackers

From Michael Paquier
Subject Re: [PATCH] Add tests for Bitmapset
Date
Msg-id aOcaIr8QKMvbIlnA@paquier.xyz
Whole thread Raw
In response to Re: [PATCH] Add tests for Bitmapset  (David Rowley <dgrowleyml@gmail.com>)
Responses Re: [PATCH] Add tests for Bitmapset
List pgsql-hackers
On Thu, Oct 09, 2025 at 02:57:41PM +1300, David Rowley wrote:
> I don't think there's any need to maintain the order of that members
> array, so couldn't you just do this?:
>
> bms = bms_del_member(bms, member);
> members[pos] = members[--num_members];

Yep, I was just playing with all that and moving the last element to
the member we know is gone would be cheaper.  I have also added more
comments to document everything in a more precise way, while going
through.

I also do not see a point in preventing inserts in the second set at
the beginning of the function.  This forces bms_union() to do more
operations with overlapping sets.

What do you think about the attached?
--
Michael

Attachment

pgsql-hackers by date:

Previous
From: Andres Freund
Date:
Subject: Re: ReadRecentBuffer() doesn't scale well
Next
From: Tom Lane
Date:
Subject: Re: Eager aggregation, take 3