docs/md/explanation/join/reactivity.md
Joined tables are fully reactive. When either source table receives an
update(), the join is automatically recomputed and any View created from the
joined table will reflect the new data. This includes:
Like SQL, join() produces a cross-product for each matching key value. When
multiple rows in the left table share the same key, each is paired with every
matching row in the right table (and vice versa). The number of output rows for
a given key is left_count × right_count.
This behavior depends on whether the source tables are indexed:
index option) — rows are appended, so duplicate
keys accumulate naturally. Each update() appends new rows, which may
introduce additional duplicates.index set to the join key) — each key appears at most
once per table, so the join produces at most one row per key. Updates replace
existing rows in-place rather than appending.Joined tables are read-only. Calling update(), remove(), clear(), or
replace() on a joined table will throw an error. Data can only change
indirectly, by updating the source tables.
The left and right tables must not have overlapping column names (other than the
join key). If a non-key column name appears in both tables, join() throws an
error. Rename columns in your source data or use View expressions to avoid
conflicts.
A source table cannot be deleted while a joined table depends on it. You must delete the joined table first, then delete the source tables.