perf: reduce bitmap index build to 1 bitmap in RAM - #6371
Merged
wkalt merged 1 commit intoApr 1, 2026
Conversation
Contributor
Author
Codecov Report❌ Patch coverage is
📢 Thoughts on this report? Let us know! |
wjones127
reviewed
Apr 1, 2026
wjones127
left a comment
Contributor
There was a problem hiding this comment.
Nice work on this!
There are a few unrelated changes to clean up, but after that it's good to merge.
| let keys_array = | ||
| ScalarValue::iter_to_array(self.keys.drain(..).collect::<Vec<_>>().into_iter()) | ||
| .unwrap(); | ||
| let mut binary_builder = BinaryBuilder::new(); |
Contributor
There was a problem hiding this comment.
suggestion: you could presize this builder:
Suggested change
| let mut binary_builder = BinaryBuilder::new(); | |
| let total_size = self.serialized.iter().map(|b| b.len()).sum(); | |
| let mut binary_builder = BinaryBuilder::with_capacity(self.serialized.len(), total_size); |
Although it might be just as efficient to do:
let bitmaps_array: BinaryArray = self.serialized.iter().collect();| vec
Bitmap index build and update previously materialized every unique value's bitmap in a HashMap before writing to disk. For high-cardinality columns (e.g. URLs with millions of unique values across thousands of fragments) this caused OOM during both initial build and append.
Replace the materialize-then-write pipeline with a streaming merge that processes one value at a time: