Expand description
JOIN Executor Algorithms
Provides multiple join strategies for different scenarios:
- Hash Join: O(n+m) for equi-joins, best for large datasets
- Nested Loop Join: O(n*m) fallback, works with any condition
- Merge Join: O(n log n + m log m) for sorted inputs
§Architecture
┌─────────────────────────────────────────────────────────────┐
│ JoinExecutor │
├─────────────────────────────────────────────────────────────┤
│ ┌───────────┐ ┌───────────────┐ ┌─────────────────────┐ │
│ │ Hash Join │ │ Nested Loop │ │ Merge Join │ │
│ │ (fast) │ │ (fallback) │ │ (sorted) │ │
│ └─────┬─────┘ └───────┬───────┘ └──────────┬──────────┘ │
│ │ │ │ │
│ └────────────────┼──────────────────────┘ │
│ ▼ │
│ ┌──────────────────────┐ │
│ │ JoinPlanner │ │
│ │ (cost-based) │ │
│ └──────────────────────┘ │
└─────────────────────────────────────────────────────────────┘Structs§
- Join
Stats - Statistics for choosing join strategy
Enums§
- Join
Condition - Join condition for filtering matches
- Join
Strategy - Strategy to use for executing the join
- Join
Type - Type of JOIN operation
Functions§
- choose_
strategy - Choose optimal join strategy based on statistics
- execute_
join - Execute a join operation using the optimal strategy
- hash_
join - Execute a hash join
- merge_
join - Execute a merge join (for sorted inputs)
- nested_
loop_ join - Execute a nested loop join (O(n*m) but works with any condition)