Repository navigation
[core] Build deletion-vector row ranges from roaring runs - #1148
Merged
Merged
Conversation
Walk the deletion vector run by run instead of row by row when turning it into non-deleted row ranges. Short runs still use next, since next_range is slower on scattered deletes. Closes apache#1146
Contributor
Author
|
@JingsongLi @leaves12138 could you take a look when you have time? |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Purpose
Linked issue: close #1146
Turning a deletion vector into non-deleted row ranges walked it one deleted row at a time, so deleting one big block cost as much as deleting the same number of scattered rows.
Brief change log
DeletionVector::deleted_ranges()returns deleted runs. Short runs are walked withnext; after 4 adjacent positions it switches to roaring'snext_rangefor the rest of the run, joining runs split at container boundaries.next_rangealone was ~6x slower on scattered deletes.dv_to_non_deleted_ranges(data_file_reader.rs) andnon_deleted_local_ranges(data_evolution_reader.rs) use it.Tests
test_deleted_ranges_edges: empty, runs of exactly 4 and 5, a run across several containers, runs ending atu32::MAX.test_deleted_ranges_match_model_on_random_bitmaps: compares against groupingbitmap.iter().dv_to_non_deleted_ranges_handles_long_runs: runs across containers and pastrow_count.Ran the same steps as ci.yml on Linux: fmt, clippy (1.98.0,
fulltext,vortex), msrv check,paimonunit tests, rest-server, and aftermake docker-upthe rust, datafusion, vortex, lumina, python and go suites. All pass. I did not run the jindo and oss-cpp suites.Read timings are in #1146 (4M-row file: 15.4 → 2.6 ms with half the rows deleted in one block, no change for scattered deletes).
API and Format
No API or format change.
deleted_rangesispub(crate).Documentation
None.