# Broadcast Join

> A join that sends a small table to every worker. The big table stays put.

**Field:** Data Engineering  
**Category:** Processing  
**Also known as:** Broadcast Hash Join, Map-Side Join, Map Join

## Think of it like

It is like giving each cook a copy of a short recipe. No one has to walk to get it.

## Definition

A broadcast join is a way to join a big table to a small one in a cluster. A full copy of the small table is sent to every worker. Each worker then joins its own slice of the big table locally. The big table never has to move across the network. Spark does this on its own when the small table is under 10 MB, unless you change that limit.

## Example

A shop joins 3 billion sales rows to a list of 200 stores. The store list goes to every worker, and the sales rows never move.

## Example code

```sql
SELECT /*+ BROADCAST(s) */ *
FROM sales t JOIN stores s ON t.store_id = s.store_id;
```

A hint that tells Spark to copy the small stores table to every worker.

## Why it matters

Moving a big table across the network is often the slowest step in a job. A broadcast join skips it.

## Common mistake

Hinting a broadcast for a table that is not small. Every worker must hold a full copy, and they can run out of memory.

## Three principles

- **Small table copied.** Every worker gets all of it.
- **Big table stays.** No shuffle across the network.
- **Size limit.** Spark does it under 10 MB by default.

## Related terms

- [SQL Join](https://learn.benibix.com/term/development/join)
- [Data Shuffle](https://learn.benibix.com/term/data/data-shuffle)
- [Apache Spark](https://learn.benibix.com/term/data/apache-spark)
- [Spark Executor](https://learn.benibix.com/term/data/spark-executor)
- [Data Skew](https://learn.benibix.com/term/data/data-skew)
- [Dimension Table](https://learn.benibix.com/term/data/dimension-table)

![A highlighted driver at the top runs your code and splits it into tasks. Arrows marked tasks lead down to three executors. Each executor holds its own slice of the big table and a highlighted copy of the small table. A note says that in a broadcast join each executor gets the small table and joins locally, so the big table never moves between machines.](https://learn.benibix.com/diagrams/dat3-spark-cluster.svg)

---

Source: https://learn.benibix.com/term/data/broadcast-join
Author: Behnia Zarei (a developer in Vienna, Austria, who builds and teaches data, AI and business intelligence at BENIBIX)
Publisher: BENIBIX Learn (https://learn.benibix.com/)
Last updated: 2026-11-19
Licence: CC BY 4.0 (https://creativecommons.org/licenses/by/4.0/). Quote freely with attribution.
