Skip to main content

Module parallel

Module parallel 

Source
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:

  1. Collecting rows from storage (sequential - storage layer limitation)
  2. Splitting rows into chunks for parallel processing
  3. Processing each chunk independently using Rayon’s work-stealing scheduler
  4. 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§

ParallelConfig
Configuration for parallel execution
ParallelHashJoinOperator
Pull-based parallel hash join.
ParallelJoinResult
Parallel hash join result

Enums§

DistanceMetric
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