Repository navigation
perf(index): coalesce small S3 shard partition reads - #11747
Merged
Merged
Conversation
BubbleCal
marked this pull request as ready for review
December 2, 2026 15:57
There was a problem hiding this comment.
Claude Code Review
This repository is configured for manual code reviews. Comment @claude review for a one-time review, or @claude review always to subscribe this PR to a review on every future push.
Tip: disable this comment in your organization's Code Review settings.
Contributor
There was a problem hiding this comment.
✅ Gate recommendation: approve.
No merge-blocking issues found. Local six-shard FLAT/SQ comparisons across V2.1/V2.2 preserved ordered rows, vector values, ownership filtering, and partition lengths while reducing range reads. Large partitions continue through the existing streaming path.
Xuanwo
approved these changes
Dec 2, 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.
Refs #6288. Small non-PQ IVF partitions can lead to three S3 range requests per partition per shard even when neighboring partitions share pages. #6289 explored using the windowed shard reader. This change preserves partition-driven writing and coalesces adjacent ranges only when multiple whole partitions fit.
The merge budgets an estimated 2 MiB of decoded payload across at most four shard windows. It detaches partial Arrow slices when they would retain a larger batch across writer buffering. This applies to IVF_FLAT, IVF_SQ, IVF_HNSW_FLAT, and IVF_HNSW_SQ auxiliary files on S3 stores with lexical listing and variable-size multipart parts. The existing streaming path handles large partitions, remaining shards, S3 Express, and constant-size multipart backends. Partition and shard order, row ownership, and file format are preserved. Measured performance below is for AWS S3 Standard.
AWS S3 Standard validation
The benchmark used one fresh process and a 512 MiB cgroup per arm on the same isolated EC2 m7i.8xlarge in us-east-1. Each fixture used eight immutable S3 Standard shards, uniform 768-dimensional IVF_SQ rows, and V2.2 auxiliary files. Output commit timing runs from the production merge call through successful multipart completion. The comparison pins base
5854ba17and candidate05a4fb06.The four 5M pairs used 2,236 partitions and varied run order and client prewarm. Warm-client setup issued eight HEADs and opened fresh merge readers. The 10M pair used 4,472 partitions at the same per-shard density. Candidate peak anonymous charge grew by 15.23–31.00 MiB in matched 5M pairs and 11.99 MiB at 10M. The 10M process RSS peak was 191.35 MiB versus 180.16 MiB. All matched arms verified the same logical rows, partition lengths and metadata, with zero cgroup-limit or OOM events. GET count fell more than GET bytes, which decreased 0.8–0.9%. The median observed GET duration, including its body, fell in the 16–32 ms histogram bucket.
A skewed filtered SQ fixture with small tail partitions and a large streaming fallback preserved all 106,669 owned rows, with 1,958 → 1,099 GETs. A separate larger-partition filtered fixture used streaming in both arms and produced identical output with 1,664 GETs each. Its single-run latency was 33.88 s for baseline and 35.71 s for the candidate.
Workspace formatting and 22 targeted merger tests passed on managed Linux. Exact-head Linux x86 and ARM CI passed. The Linux x86 suite also passed the existing HNSW FLAT and SQ segment merge and graph rebuild cases.