Repository navigation
perf(load): fan out a csv overwrite's Lance writers over file-sized chunks - #1121
Merged
azimafroozeh merged 4 commits intoOct 21, 2026
Merged
Conversation
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 3e0f91f916
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
This was referenced Oct 22, 2026
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.
What & why
A
load csvoverwrite stages its table through one Lance call, which writes the table's data files one after another. On SF30 that serial write is 104 s of the 503 s load (#1099's phase table), with every other writer idle while Comment's 67 M rows go out file by file. This PR cuts the validated batches at Lance's file target (1 M rows) into chunks, runs one uncommitted Lance write per chunk with up tostage_write_concurrency(default 8) in flight, and joins the chunks' fragments in chunk order into oneOperation::Overwrite. Each chunk is exactly the file the single call would have cut and Lance numbers fragments in list order at commit, so the committed files, their order and the single commit are unchanged while the file writes overlap: SF30's write phase drops to 47 s and the load to 413 s.Backing issue / RFC
docs/rfcs/2026-10-15-bulk-load-as-a-query-plan.md(feat(load): plan CSV overwrites and reuse validation reads #1026, perf(load): check edge endpoints in an unchained integer key set #1085, feat(explain): cut pipelines at breakers on every route and measure a load's operators #1099): its sink stages one Lance call per table, so the fan-out inside that call owes the RFC a sentence; D11 (each phase holds its whole input) is unchanged.Checklist
table_store, since the width is a process setting and every GQT case stays under 1 M rows (one chunk): chunk order and exactly-once at a 4-row chunk target with 3 writers (14 rows in 3-row batches, fragments[4, 4, 4, 2], staged ids1..=4, rows read back in input order before and after the commit), and the one-schema refusal before any writer starts (no data file written, HEAD unchanged, a zero-row batch of another schema dropped as before). The GQT corpus (412 cases) is unchanged.docs/user/queries/settings.md,docs/user/mutations/index.md;docs/dev/writes.mdfor the mechanismchangelog.d/load-csv-overwrite-writers.performance.mdOperation::OverwriteLocal verification
load csv … mode overwritestatements throughomnigraph mutate --json, release builds ofmain(b692610c) and this branch, one round each, phases read fromexecuted.operatorsas in feat(explain): cut pipelines at breakers on every route and measure a load's operators #1099: load 503.0 → 412.9 s, write phase 104.3 → 47.3 s, Comment's write 18.2 → 5.6 s; parse (190 s, one thread) is now the long pole.OMNIGRAPH_LOAD_CONCURRENCY), 2 rounds interleaved: load 13.22 → 12.00 s, write 2.63 → 2.18 s; only the six tables above 1 M rows change (write 1.3× to 1.5× faster).mainequals this branch at width 1 within 3 %.Notes for reviewers
stage_write_concurrency(OMNIGRAPH_LOAD_CONCURRENCY) now also widens the Lance writes inside oneload csvoverwrite;1restores the serial write.write_max_bytes(32 MiB default) as its Lance accumulation allowance, so a table above 1 M rows can hold up tostage_write_concurrencytimes that in writer buffers. The allowance was already per writer; dividing it by the width would shrink a wide table's pages, and the numbers above were taken per writer.