]> git.ipfire.org Git - thirdparty/postgresql.git/commit
Update nbits_set in brin_bloom_union
authorTomas Vondra <tomas.vondra@postgresql.org>
Sun, 14 Apr 2024 15:58:59 +0000 (17:58 +0200)
committerTomas Vondra <tomas.vondra@postgresql.org>
Sun, 14 Apr 2024 16:17:29 +0000 (18:17 +0200)
commit3cd4135119be0dda37ef810353a3ef2e4444970e
treea44ffe8ac6b1f6a4f827a316519e0579cbb0a21d
parent7c490a18b75b895c757a5340c33e05ca44a178f9
Update nbits_set in brin_bloom_union

Properly update the number of bits set in the bitmap after merging the
filters in brin_bloom_union.

This is mostly harmless, as the counter is used only in the output
function, which means pageinspect may show incorrect information about
the BRIN summary. The counter does not affect correctness.

Discovered while adding a regression test comparing indexes built with
and without parallelism. The parallel index builds exercise the union
procedure when merging results from workers, which is otherwise very
hard to do in a test. Which is why this went unnoticed until now.

Backpatch through 14, where the BRIN bloom opclasses were introduced.

Backpatch-through: 14
Discussion: https://postgr.es/m/1df00a66-db5a-4e66-809a-99b386a06d86%40enterprisedb.com
src/backend/access/brin/brin_bloom.c