perf(transaction): backport O(M+N) fragment matching in build_manifest onto v9.0.1 - #11
Merged
Conversation
…or Update/Delete (lance-format#8210) Closes: lance-format#8209
…on pylance 9.0.1+exa.1
Author
🤖 Devin AI EngineerI'll be helping with this pull request! Here's what you should know: ✅ I will automatically:
Note: I can only respond to comments from users who have write access to this repository. ⚙️ Control Options:
|
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.
Summary
Backports upstream lance-format#8210 (commit
14c5f3cc, first released only in v11 betas) onto the stablev9.0.1tag, so the Exa fork can ship the fix in a9.0.1+exa.1pylance wheel — the version silk_node's master locks now pin.Transaction::build_manifestforUpdate/Deletematched updated fragments against existing fragments with a per-fragment linear scan (updated_fragments.iter().find(|uf| uf.id == f.id)), i.e. O(M×N). On Orion column-backfill commits touching 4096–8192 fragments against a ~1M-fragment table this dominates commit time (and repeats on every conflict retry). The backport replaces it with:Semantics are unchanged: same first-match duplicate behavior, same overlay carry-forward and
RewriteColumnstombstoning, output ordering still follows the existing-fragments iteration. One conflict hunk from the upstream commit (reusing the maps inoriginal_overlaid_frags) was dropped because v9.0.1 doesn't have that code path; the backported test neededmerged_generationsinstead of upstream'scompacted_sstablesfield.Also bumps
python/Cargo.tomlto9.0.1+exa.1so the fork wheel is distinguishable from PyPI 9.0.1.Verified:
cargo test -p lance --lib dataset::transaction::— 60/60 pass (incl. the two new tests from lance-format#8210);cargo fmtclean; built abi3 x86_64 + aarch64 manylinux wheels and smoke-tested a realLanceOperation.Updatecommit.Supersedes #10 (same backport onto v7.0.0, made obsolete by the silk_node pylance 9.x bump).
Link to Devin session: https://app.devin.ai/sessions/9589ce7177cd42afbae9db44fc352d5b
Requested by: @ryantqiu