lance-format / lance-format/lance

Building Bitmap indexes uses a large number of allocations

Open
#5,494 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

A-index performance
Dominant language
Rust
Stars
7.1k
Forks
852
Avg merge
3d 18h
Merged PRs (30d)
272

Description

Indexing 100MB of int64 data creates 1.4 million allocations.

Most of this seems to come from resizing containers within the RoaringBitmaps when calling insert.

https://github.com/lance-format/lance/blob/8d2f1bfc411f6b5e4561cf8f93462010ae2ee615/rust/lance-index/src/scalar/bitmap.rs#L731

RoaringBitmaps are designed to be efficiently built from data in ascending order. In theory, we should already be delivering data in order of row_address, so we might be able to speed this up easily by taking advantage of that.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start at rust/lance-index/src/scalar/bitmap.rs around line 731 and inspect how insert resizes the RoaringBitmaps. Reproduce the 100MB int64 indexing case and measure allocations, then verify that exploiting ascending row_address input reduces allocations without changing bitmap results.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
databases
Issue type
Refactor
Difficulty
3/5
Estimated time
1-2 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
62/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.