Repository navigation
[core] Keep the rbm32 and rbm64 union decoded between rows - #1568
JeonDaehong wants to merge 1 commit into
Conversation
JingsongLi
left a comment
There was a problem hiding this comment.
Keeping the union decoded has clear value for high-cardinality aggregates. I ran 5,286 core and primary-key table tests on 57677458, including a new write, commit, scan, and compaction probe. The probe found a release-mode write latency regression for fragmented rbm64 inputs.
| Entry::Vacant(vacant) => { | ||
| vacant.insert(container); | ||
| } | ||
| Entry::Occupied(mut occupied) => occupied.get_mut().union(container), |
There was a problem hiding this comment.
[P2] Promote fragmented rbm64 unions to a bitset as they grow. I wrote a single batch of 32,768 rows to one key in an aggregation table with fields.bitmap.aggregate-function=rbm64. Each row holds a singleton bitmap for (1 << 40) + 2 * i, so all values share a high-48-bit container and remain fragmented. Three release runs measured 177–190 ms for write through commit on e4b84b47 and 625–640 ms on this head. The union bytes matched before and after compaction.
On main, intermediate encoding promotes fragmented containers to bitsets, which the next union decodes as Words. With the decoded accumulator, each singleton stays on Ranges::union and sorts and scans the growing range list. Please promote dense, fragmented ranges in memory using the same size threshold as encoding, and include this input shape in the benchmark.
Purpose
Closes #1567.
rbm32andrbm64deserialized and re-serialized the accumulated bitmap for every row, so a key with many rows took time quadratic in its bitmap size.Brief change log
result()serializes the union. A lone input is still returned unchanged.Tests
keeps_a_lone_input_and_resets_the_unionin both files checks that a lone Java input is returned byte for byte, that the union is right, and thatresetclears it.Measured on c7i.8xlarge, release build, main and this branch alternated 3 times (ranges across runs). The output bytes hash the same on both for every shape.
Writing one commit through a table with
rbm32:Aggregating directly, 1 key with N single-value bitmaps:
One input per key is unchanged (25–26 ms for 100,000 keys either way). Three inputs per key, 100,000 keys: rbm32 81 → 60 ms, rbm64 129 → 98 ms.
API and Format
No public API or storage format changes.
Documentation
None.