Re: Add bms_offset_members() function for bitshifting Bitmapsets

From: David Rowley <dgrowleyml(at)gmail(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Chao Li <li(dot)evan(dot)chao(at)gmail(dot)com>, PostgreSQL Developers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Re: Add bms_offset_members() function for bitshifting Bitmapsets
Date: 2026-04-18 07:49:57
Message-ID: CAApHDvrp6JwOVH3VwMB=YL3p97F5_0hKJc7J8zHRKuyhKru1dA@mail.gmail.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Wed, 15 Apr 2026 at 14:33, David Rowley <dgrowleyml(at)gmail(dot)com> wrote:
>
> On Wed, 15 Apr 2026 at 14:30, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:
> >
> > David Rowley <dgrowleyml(at)gmail(dot)com> writes:
> > > I'd not considered surprise-prone as an aspect. I understand we have
> > > bms_join and bms_union, which do the same thing if you only care about
> > > the value of the result and not what happens to the inputs.
> >
> > Sure, but bms_join is an optional optimization of the far safer
> > bms_union operation. It bothers me to create the optimized case
> > but not the base case.
>
> Hmm, yeah. That seems like a good argument for making a new set. I'll
> go make it so.

Patch attached for the version that creates a new set rather than
modifying the input set in-place.

David

Attachment Content-Type Size
v2-0001-Introduce-bms_offset_members-function.patch application/octet-stream 20.4 KB

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message David Rowley 2026-04-18 07:53:40 Re: Add bms_offset_members() function for bitshifting Bitmapsets
Previous Message Xuneng Zhou 2026-04-18 04:19:50 Re: test: avoid redundant standby catchup in 049_wait_for_lsn