Repository navigation
Conversation
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.
This was referenced Nov 9, 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.
closes #999
Description
The parquet base-file reader fetched a row group's column chunks only after the previous row group was decoded.
PrefetchingReader, anAsyncFileReaderwrapper, now starts fetching the next selected row group's chunks in a spawned task while the current one decodes. It learns the columns from the reader's own requests (under a row filter, only the filter stage's), serves only ranges a prefetched chunk fully contains, and falls back to a normal fetch when a prefetch fails. It stays at most one row group ahead and aborts in-flight work on drop; on a current-thread runtime the overlap is limited to when the consumer yields.Impact: TPC-H Q6 at SF100 on S3, read through DuckDB's hudi extension, went from 7.49-7.62 s to 6.51-6.59 s at 16 threads (-13%) and from 3.99-4.16 s to 3.76-3.85 s at 32 threads (two alternating runs each, same instance). The 22-query SF10 S3 total moved within run-to-run noise (warm median 38.1 s to 37.5 s).
How are the changes test-covered
Tests in
tests::prefetchcheck that prefetched reads match unprefetched ones, and cover row filters, page-index selections, row-group selection, buffer retention and failed prefetches.