CTRL + S our souls
Optimization #10

Probing Parallelization

Executing the probe phase concurrently while merging results efficiently.

The Strategy

Following the parallel build phase, the probing phase must also be distributed across available threads to maximize throughput.

The workload is split among threads, allowing simultaneous lookups into the shared hash table constructed in the previous step.

Core Components

  • Threaded Probing: Concurrent execution of lookup operations.
  • Single-Threaded Aggregation: Collecting partial results into the final output buffer.

Implementation

Each thread processes a partition of the probe relation. Upon finding a match in the global hash table, the thread writes the result to a thread-local buffer to avoid contention.

Once all threads complete their probing tasks, a designated thread (or the main thread) aggregates these local buffers into the final result structure.