Scale the Parquet read path to 100k–1M rows and many parts #10
Labels
No labels
Compat/Breaking
Kind/Bug
Kind/Documentation
Kind/Enhancement
Kind/Feature
Kind/Security
Kind/Testing
Priority
Critical
Priority
High
Priority
Low
Priority
Medium
Reviewed
Confirmed
Reviewed
Duplicate
Reviewed
Invalid
Reviewed
Won't Fix
Status
Abandoned
Status
Blocked
Status
Need More Info
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
zoo/eve#10
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Context
The Parquet Arrow fast path (#9) evaluates raw non-string queries on
RecordBatches and only materialises the returned page. At 10k rows this is already faster than ClickHouse, but the current implementation still:store::read_batches);RecordBatch;lexsort_to_indices(top-k only limits the index array, not the concatenated input);At 100k–1M rows and up to 64 parts this becomes slow and memory-heavy: the peak is the full filtered set plus the concatenation, and parts are scanned one at a time.
Scope
1. Projection pushdown
Derive the required columns from the filter, sort,
include/excludeand transform keys, and pass aProjectionMasktoParquetRecordBatchReaderBuilder. Do not read a column that is neither filtered, sorted, grouped nor returned. Preserve the currentbatch_to_rowsoutput shape (projection still happens at the JSON boundary).2. Parallel part reads
Read parts concurrently with bounded parallelism (a fixed worker count, e.g. the available parallelism or a configurable constant), preserving deterministic part order for ties. Bound the in-flight memory: do not read all parts at once when the table is large. Use the existing blocking pool (
spawn_blocking/rayon) and keep the async runtime responsive.3. Streaming top-k
Avoid concatenating every filtered row. Keep only the candidates needed for
offset + limitacross batches/parts (a bounded heap or a merge of per-part top-k results), while still counting the exacttotalfrom the filter masks. Return the same stable order: sort fields in order, original row index as the final tie-break, nulls last in both directions.4. Row-group pruning
Use Parquet column statistics (min/max, null counts) for supported predicates to skip part files and row groups that cannot match:
Eq,In,Lt,Le,Gt,Ge;Report skipped parts/row groups through
tracingat debug level.Acceptance criteria
eve_e2e/tests/tsdbtests pass.tsdbbenchmark cases at 100k and 1M rows with 1 and 64 parts, including a wide entity (includea subset of columns) and a selective filter; document before/after latency and peak memory.limitis small.cargo fmt --all -- --check,cargo clippy --workspace --all-targets -- -D warnings,cargo test -p eve_tsdb_parquet,cargo test -p eve_e2e --test tsdb --test apppass.adr/parquet.mddocuments projection pushdown, bounded parallel reads, streaming top-k and pruning.Non-goals