lance-format / lance-format/lance

Choose between horizontal and vertical merge insert based on data width

Open
#4,495 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

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

Description

Currently there are two approaches we can take during merge insert.

A horizontal merge insert does not create a new fragment. It tombstones the columns that are being modified and rewrites those columns. This introduces write amplification based on the columns being updated (the entire column(s) must be rewritten).

A vertical merge insert marks the updated rows deleted and writes new rows. This introduces write amplification based on the columns not being updated (since they must be rewritten into the new rows).

Currently we choose horizontal merge insert if the incoming data is a partial schema and vertical merge insert if the incoming data is the full schema. However, this is not always the correct choice. For example, a user created a table where an image column started out as null and then started to backfill the image column. Since they were only filling in the image column this led to a tremendous amount of write amplification because a horizontal merge insert was being used.

We could potentially choose the correct strategy based on the sizes of the columns being modified.

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 by tracing the existing horizontal and vertical merge insert paths and how they determine the incoming schema and column sizes. Define and validate a strategy-selection rule that reduces write amplification, with tests showing the chosen approach for partial updates such as backfilling one column and for full-schema updates.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
database
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.