Skip to content

perf(core): split large base-file reads into concurrent ranged requests - #1004

Draft
yihua wants to merge 2 commits into
apache:mainfrom
yihua:perf/parallel-range-get
Draft

yihua wants to merge 2 commits into
apache:mainfrom
yihua:perf/parallel-range-get

Conversation

@yihua

@yihua yihua commented Nov 9, 2026 •

Copy link
Copy Markdown
Contributor

closes #1000

Description

Stacked on #1003; review the last commit.

Large base-file reads were one GET on one connection. SplittingReader, innermost under the read-volume counters, coalesces ranges the way object_store does, then splits ranges larger than 8 MiB into concurrent parts (at most 8 in flight per call), assembled in place into one buffer per merged range; requested ranges are sliced from it zero-copy. Small reads are unchanged, and io_calls counts once per call. A connection cap shared across readers is left for a follow-up.

Impact, measured on an earlier revision of this change applied together with #1002: TPC-H Q6 at SF100 on S3 through DuckDB went from 6.60-7.05 s to 5.79-5.93 s at 16 threads (-13%), with 32 threads unchanged (3.72-3.97 s to 3.67-3.68 s). Over the 22-query SF10 S3 run, leaving out Q5 (whose plan #1002 changes), the warm total went from 32.5 s to 30.6 s and the cold total from 74.3 s to 70.8 s.

How are the changes test-covered

  • N/A
  • Automated tests (unit and/or integration tests)
  • Manual tests
    • Details are described below

New tests check that split reads return the same bytes as unsplit ones, over an in-memory reader and an object store, and cover coalescing, part tiling, out-of-order completion, failed and mis-sized parts, and call counting.

yihua added 2 commits November 8, 2026 23:20
The parquet stream asks for a row group's column chunks only after it
has finished decoding the previous one, so a base-file read never
overlaps a fetch with decoding.

PrefetchingReader wraps the AsyncFileReader under the stream. It maps
each request to the row group and leaf columns it falls in, and starts
fetching the full chunks of those columns for the next selected row
group in a spawned task. Under a row filter it learns only the filter
stage's columns, since the stream fetches the rest only for groups where
a row survives. A request is served from a prefetched chunk only when
the chunk holds the whole range, and a failed prefetch falls back to a
normal fetch. It stays at most one row group ahead and aborts any task
in flight when dropped. On a current-thread runtime the prefetch runs
only while the consumer yields, so the overlap there is limited.

AbortOnDrop moves to util::concurrency so the reader and the write path
share it.
A large base-file read went out as one GET on one connection, so a big
column chunk was capped at that connection's throughput.

SplittingReader sits innermost, under the read-volume counters. It
coalesces the requested ranges the way object_store does, and splits
each coalesced range larger than 8 MiB into near-equal parts fetched
concurrently, at most 8 in flight per call. Parts are copied into one
buffer per coalesced range as they land, and the requested ranges are
sliced from those buffers without copying. A call whose coalesced
ranges all fit in one part is passed through unchanged, and io_calls
still counts a split call once.
@codecov

codecov Bot commented Nov 9, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 90.47619% with 20 lines in your changes missing coverage. Please review.
✅ Project coverage is 90.95%. Comparing base (6ba42e7) to head (7305460).

Files with missing lines Patch % Lines
crates/core/src/file_group/base_file/parquet.rs 90.24% 20 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1004      +/-   ##
==========================================
- Coverage   90.96%   90.95%   -0.01%     
==========================================
  Files         154      154              
  Lines       22070    22260     +190     
==========================================
+ Hits        20076    20247     +171     
- Misses       1994     2013      +19     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Split large parquet base-file reads into concurrent ranged requests

1 participant