Skip to content

feat: add bounded Parquet row-group prefetch - #5

Draft
peterxcli wants to merge 1 commit into
codex/parquet-io-1-policyfrom
codex/parquet-io-2-prefetch
Draft

peterxcli wants to merge 1 commit into
codex/parquet-io-1-policyfrom
codex/parquet-io-2-prefetch

Conversation

@peterxcli

@peterxcli peterxcli commented Sep 15, 2026

Copy link
Copy Markdown
Owner

Which issue does this PR close?

Related to apache#24393. Stage 2 of the Parquet I/O stack, based on #4.

Stack, with each PR targeting its predecessor: #4#5#7#8#9.

Rationale for this change

A scan can leave CPU workers idle while fetching the next row group. Start one future row-group read while the current reader produces batches.

What changes are included in this PR?

Add ParquetSource::with_row_group_prefetch(bytes, memory_pool) with a per-stream cap, reservations in the query memory pool, cancellation, and ordinary demand-read fallback. Prefetch preserves page selections and fully matched group suppression. Yield after starting the task so downstream CPU work cannot strand its I/O in a worker's local queue. Add prefetch metrics and a ClickBench option.

What is the testing strategy for this PR?

On lsa-cupid1: workspace Clippy with all targets/features; 265 Parquet tests; SQL page-pruning coverage; regressions for overlap, limits, memory pressure, cancellation, and speculative read failures. The workspace extended test suite passed with a private PID namespace, CPUs 96–111, and a 65,536 file limit.

Fork CI’s security audit reports RUSTSEC-2026-0285 in the baseline’s rustls 0.23.39. This stack leaves Cargo.lock unchanged; all other checks passed.

Full partitioned ClickBench on lsa-cupid1, /work/peterxcli NVMe: 100 files, 99,997,497 rows, all 43 queries, eight workers/partitions. Versus the immediate parent, the sum of query medians changes -1.86% / -1.22% warm and -2.33% with evicted files (negative is faster). Warm values are two reversed-order passes; evicted files use three runs per query.

Keep opt-in. Q29 with 8 ms added per read improves 8.23% versus the parent. The scheduling yield is included in this PR, so its effect is not measured separately. Results and methodology · 43 per-query comparisons and CPU charts. Result-ordering limitations and synthetic-latency controls are documented in the report.

Are there any user-facing changes?

Prefetch is opt-in, execution-local, and independent of the demand I/O policy. It can read bytes subsequently discarded by filters. The ClickBench runner accepts --prefetch-bytes; zero disables it.

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant