Expand description
Optimized hash table for join operations.
This module provides a specialized hash table designed for the build phase of hash joins. Key optimizations:
- Pre-allocated: Sized upfront based on build side cardinality
- Cache-efficient: Linear probing within cache lines
- Zero-allocation probe: Iterator returns indices without allocation
- Full hash stored: Quick rejection without row access
§Memory Layout
JoinHashTable
├── bucket_heads: Vec<i32> [bucket_count] // First entry index per bucket
├── entries: Vec<HashEntry> [row_count] // One per build row
└── bucket_mask: u64 // For fast modulo
HashEntry (16 bytes, cache-aligned)
├── hash: u64 // Full hash for quick rejection
├── row_idx: u32 // Index into build rows
└── next: u32 // Next in chain (EMPTY = end)Structs§
- Join
Hash State - Immutable build-side state shared by every probe consumer of one physical JOIN edge.
- Join
Hash Table - Optimized hash table for join operations.
- Probe
Cursor - Borrow-free position in one hash bucket chain.
- Probe
Iter - Zero-allocation iterator over probe results.
Traits§
- Join
Hash Observer - Minimal sink used while a JOIN hash table and a probe accelerator are populated in one pass. The optimizer owns the accelerator; the physical hash foundation depends only on this lifecycle-neutral contract.
Functions§
- hash_
keys_ with - Hash values at given indices using a get function.
- hash_
row_ keys - Hash row key columns into a single u64.
- verify_
key_ equality - Verify that two rows have equal key values.