perf(fs): avoid redundant object-store metadata requests for known-size files - #189
Open
mrdrivingduck wants to merge 1 commit into
Open
perf(fs): avoid redundant object-store metadata requests for known-size files#189mrdrivingduck wants to merge 1 commit into
mrdrivingduck wants to merge 1 commit into
Conversation
Allow callers with trusted file metadata to open streams with a known size and avoid a metadata request for object storage. Use data-file metadata in split reads while retaining Open(path) as the default implementation. Co-authored-by: GPT-5.6 Terra <codex@users.noreply.github.com>
mrdrivingduck
marked this pull request as ready for review
August 7, 2026 16:22
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.
I am not sure whether introducing a new
FileSystemAPI is acceptable upstream, but...Summary
This PR adds an
Open(path, file_size)path to the object store file system API for callers that already have trusted file metadata.Paimon split reads already carry the data-file size from manifest metadata. Passing that size through avoids a per-file object metadata request, while retaining
Open(path)as the default path for callers without a known size.This is a generic object store optimization. My WIP OSS(v2) filesystem uses the supplied size to skip its per-file
HeadObjectrequest, and the S3 filesystem can use the same known-size opening path.Benchmark
The benchmark exercises My WIP OSS(v2) filesystem, using the same real Paimon table throughout:
oss://paimon-cpp-fs/paimon-cpp-demo-20260710-220136/demo.db/eventscount(*) = 786,435,sum(quantity) = 39,713,738The only difference is how data files are opened:
Open(path), which requires oneHeadObjectrequest per file.Open(path, file_size), which uses the file size already present in the Paimon manifest and skips that request.Open(path)Open(path, size)threads=8, 5 independent processesthreads=1, 5 independent processesThe largest gain occurs when many known-size files are opened sequentially with little or no reading, which isolates the cost of the per-file metadata request. In an end-to-end DuckDB scan, file reads, decoding, and concurrency reduce the relative impact, but the aggregate query still shows a stable 19.7%–28.4% mean latency reduction on this 96-file table.
End-to-end query
Raw timings from five independent processes:
Open(path)Open(path, size)threads=8threads=1