Expand description
Parallel Query Execution
This module provides parallel execution strategies for CPU-intensive query operations:
- Parallel Scan + Filter: Process table rows in parallel chunks with WHERE evaluation
- Parallel Aggregation: Already implemented in aggregation.rs
- Parallel Join: Parallel hash join build/probe phases
§Architecture
The parallel execution model works by:
- Collecting rows from storage (sequential - storage layer limitation)
- Splitting rows into chunks for parallel processing
- Processing each chunk independently using Rayon’s work-stealing scheduler
- Merging results back together
§Thresholds
Parallelization has overhead, so we only use it when beneficial:
- Table scan + filter: 10,000+ rows
- Aggregation: 100,000+ rows (already in aggregation.rs)
- Hash join: 10,000+ build rows
Re-exports§
pub use super::operators::hash_join::JoinType;
Structs§
- Parallel
Config - Configuration for parallel execution
- Parallel
Hash Join Operator - Pull-based parallel hash join.
- Parallel
Join Result - Parallel hash join result
Enums§
- Distance
Metric - Distance metric for vector search
Constants§
- DEFAULT_
PARALLEL_ CHUNK_ SIZE - DEFAULT_
PARALLEL_ FILTER_ THRESHOLD - DEFAULT_
PARALLEL_ JOIN_ OUTPUT_ BATCH_ BYTES - DEFAULT_
PARALLEL_ JOIN_ OUTPUT_ BATCH_ ROWS - DEFAULT_
PARALLEL_ JOIN_ THRESHOLD
Functions§
- parallel_
filter - Parallel filter execution for WHERE clause evaluation
- parallel_
hash_ join_ cancellable - parallel_
join_ state_ retained_ bytes - parallel_
topn_ vector_ search - Parallel brute-force k-NN vector search