]> git.ipfire.org Git - thirdparty/postgresql.git/commit
Introduce bms_offset_members() function
authorDavid Rowley <drowley@postgresql.org>
Wed, 8 Jul 2026 13:11:42 +0000 (01:11 +1200)
committerDavid Rowley <drowley@postgresql.org>
Wed, 8 Jul 2026 13:11:42 +0000 (01:11 +1200)
commitbb7ded1eebed708865d9bb0a3513c7ed3afe7065
tree6f36068624134c85dcbb2f16f7b32cef8c443004
parent3601f976c2e99123203413fd157f117632b3db78
Introduce bms_offset_members() function

Effectively, a function to bitshift members by the specified number of
bits.  We have various fragments of code doing this manually with a
bms_next_member() -> bms_add_member() loop.  We can do this more
efficiently in terms of CPU and memory allocation by making a new
Bitmapset and bitshifting in the words of the old set to populate it.

Author: David Rowley <dgrowleyml@gmail.com>
Reviewed-by: Chao Li <li.evan.chao@gmail.com>
Reviewed-by: Greg Burd <greg@burd.me>
Discussion: https://postgr.es/m/CAApHDvq=eEdw2Qp+aSzSOtTSe+h0fnVQ55CcTNqBkLDYiRZmxw@mail.gmail.com
src/backend/nodes/bitmapset.c
src/backend/optimizer/plan/setrefs.c
src/backend/optimizer/prep/prepjointree.c
src/backend/rewrite/rewriteManip.c
src/backend/statistics/extended_stats.c
src/include/nodes/bitmapset.h
src/test/modules/test_bitmapset/expected/test_bitmapset.out
src/test/modules/test_bitmapset/sql/test_bitmapset.sql
src/test/modules/test_bitmapset/test_bitmapset--1.0.sql
src/test/modules/test_bitmapset/test_bitmapset.c