Skip to content

dbsp: add size estimate for bloom filter blocks.#5704

Merged
gz merged 1 commit intomainfrom
into-block-fix
Feb 26, 2026
Merged

dbsp: add size estimate for bloom filter blocks.#5704
gz merged 1 commit intomainfrom
into-block-fix

Conversation

@gz
Copy link
Contributor

@gz gz commented Feb 26, 2026

This passes an accurate size estimate for bloom filter blocks when we build them so we can appropriately size the FBuf for it in advance.

The problem surfaced when I changed the FBuf grow policy to strictly grow to the requested size instead of power of two increments. I do think this can be a problem in practice: say a 9 GiB bloom filter is built we will grow the buffer from 4 KiB all the way to 16 GiB. With this it should just do one allocation of 9 GiB upfront.

The other place where we used this was for footer blocks, where 4KiB is a fine (over)estimate.

Describe Manual Test Plan

I ran a bunch of tests looking at FBuf resizing and confirmed there is no resize anymore for writing the bloom filter.

@gz gz requested a review from blp February 26, 2026 00:54
This passes an accurate size estimate for bloom filter blocks
when we build them so we can appropriately size the FBuf for it.

The problem surfaced when I tested a different FBuf grow policy to
strictly grow to the requested size instead of power of two
increments (not included in this commit).

I do think this can be a problem in practice: say 9 GiB
bloom filter is built it will grow the allocation from
4 KiB to 16 GiB.

The other place where we used this was for footer
blocks, where 4KiB was a fine estimate.

Signed-off-by: Gerd Zellweger <mail@gerdzellweger.com>
Copy link
Member

@blp blp left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch. Thank you.

@gz gz added this pull request to the merge queue Feb 26, 2026
Copy link
Collaborator

@mythical-fred mythical-fred left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@gz gz removed this pull request from the merge queue due to a manual request Feb 26, 2026
@gz gz added this pull request to the merge queue Feb 26, 2026
@snkas snkas removed this pull request from the merge queue due to a manual request Feb 26, 2026
@gz gz added this pull request to the merge queue Feb 26, 2026
Merged via the queue into main with commit c4b5c59 Feb 26, 2026
3 checks passed
@gz gz deleted the into-block-fix branch February 26, 2026 20:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants