Skip to content

[core] Build deletion-vector row ranges from roaring runs - #1148

Merged
JingsongLi merged 1 commit into
apache:mainfrom
JeonDaehong:perf-dv-ranges
Oct 18, 2026
Merged

JingsongLi merged 1 commit into
apache:mainfrom
JeonDaehong:perf-dv-ranges

Conversation

@JeonDaehong

Copy link
Copy Markdown
Contributor

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 with next; after 4 adjacent positions it switches to roaring's next_range for the rest of the run, joining runs split at container boundaries. next_range alone was ~6x slower on scattered deletes.
  • dv_to_non_deleted_ranges (data_file_reader.rs) and non_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 at u32::MAX.
  • test_deleted_ranges_match_model_on_random_bitmaps: compares against grouping bitmap.iter().
  • dv_to_non_deleted_ranges_handles_long_runs: runs across containers and past row_count.

Ran the same steps as ci.yml on Linux: fmt, clippy (1.98.0, fulltext,vortex), msrv check, paimon unit tests, rest-server, and after make docker-up the 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_ranges is pub(crate).

Documentation

None.

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
@JeonDaehong

Copy link
Copy Markdown
Contributor Author

@JingsongLi @leaves12138 could you take a look when you have time?

@JingsongLi JingsongLi left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

+1

@JingsongLi
JingsongLi merged commit d8072a1 into apache:main Oct 18, 2026
16 checks passed
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.

[core] Build deletion-vector row ranges from roaring runs

2 participants