Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 2f20ced

Browse filesBrowse files
committed
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
1 parent 9358297 commit 2f20ced
Copy full SHA for 2f20ced

File tree

Expand file treeCollapse file tree

1 file changed

+3
-0
lines changed
Filter options
Expand file treeCollapse file tree

1 file changed

+3
-0
lines changed

‎src/backend/access/brin/brin_bloom.c

Copy file name to clipboardExpand all lines: src/backend/access/brin/brin_bloom.c
+3Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -691,6 +691,9 @@ brin_bloom_union(PG_FUNCTION_ARGS)
691691
for (i = 0; i < nbytes; i++)
692692
filter_a->data[i] |= filter_b->data[i];
693693

694+
/* update the number of bits set in the filter */
695+
filter_a->nbits_set = pg_popcount((const char *) filter_a->data, nbytes);
696+
694697
PG_RETURN_VOID();
695698
}
696699

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.