Skip to content

perf(transaction): backport O(M+N) fragment matching in build_manifest onto v7.0.0 - #10

Merged
ryantqiu merged 3 commits into
exa/v7.0.0from
exa/v7.0.0-txn-perf
Aug 14, 2026
Merged

perf(transaction): backport O(M+N) fragment matching in build_manifest onto v7.0.0#10
ryantqiu merged 3 commits into
exa/v7.0.0from
exa/v7.0.0-txn-perf

Conversation

@devin-ai-integration

Copy link
Copy Markdown

Summary

Backports upstream lance-format#8210 (commit 14c5f3cc) onto the v7.0.0 tag, for a patched pylance 7.0.0 build used by the silk_node column-backfill committer.

Transaction::build_manifest for Update/Delete matched each existing dataset fragment against the transaction's fragments with a linear scan (updated_fragments.iter().find(|uf| uf.id == f.id)) → O(M×N). With ~3M dataset fragments and 8192-fragment backfill commits this dominates commit time (observed 300s → 1200s+ growth per commit). The backport replaces the scans with pre-built lookups:

let removed_ids: HashSet<u64> = removed_fragment_ids.iter().copied().collect();
let updated_by_id: HashMap<u64, &Fragment> = /* first-wins over updated_fragments */;
...
if let Some(&updated) = updated_by_id.get(&f.id) { ... }

Deviations from the upstream commit (v7 differences only, semantics identical):

  • v7's overlay handling in the Update arm (updated.overlays = f.overlays.clone() + tombstone_overlay_fields under RewriteColumns) is preserved inside the map-lookup branch.
  • Backported test uses v7's merged_generations field name (upstream renamed it compacted_sstables) and LanceFileVersion::V2_0 in the test helper.

Verified: cargo check -p lance clean, all 53 dataset::transaction tests pass (incl. the two new tests from lance-format#8210), rustfmt clean.

Link to Devin session: https://app.devin.ai/sessions/9589ce7177cd42afbae9db44fc352d5b
Requested by: @ryantqiu

@devin-ai-integration

Copy link
Copy Markdown
Author

🤖 Devin AI Engineer

I'll be helping with this pull request! Here's what you should know:

✅ I will automatically:

  • Address comments on this PR. Add '(aside)' to your comment to have me ignore it.
  • Look at CI failures and help fix them

Note: I can only respond to comments from users who have write access to this repository.

⚙️ Control Options:

  • Disable automatic comment, CI, and merge conflict monitoring

@ryantqiu
ryantqiu merged commit 37b0f22 into exa/v7.0.0 Aug 14, 2026
3 of 12 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants