---
title: "mlab-builtins-table-joins — Mova code model"
description: "Mova code model of mlab/src/builtins/table.rs: components with their labels, obernants and the model text."
url: "https://groupants.elamur.ai/free/en/mova/mlab/src/builtins/table.rs.groupant/joins.groupant/"
---
Elamur: [Mova](https://md.mova.elamur.ai/free/en/) · [Dictionary](https://md.dictionary.elamur.ai/free/en/) · [Research](https://md.research.elamur.ai/free/en/) · **Groupants**

This page as HTML: <https://groupants.elamur.ai/free/en/mova/mlab/src/builtins/table.rs.groupant/joins.groupant/>

# mlab-builtins-table-joins

The groupant beside mlab/src/builtins/table.rs in the Mova repository: what the code computes, what it never does, how to go back from its outputs, its invariants, cost and checks.

## Facts

- **kind:** groupant_fragment
- **status:** partial source bound model
- **source:** [`mlab/src/builtins/table.rs`](https://github.com/ElamurAI/mova-free/blob/main/mlab/src/builtins/table.rs)
- **source SHA-256:** `f1b0959092cfcdd3…`
- **covers:** right_index stores nonmissing key rows in appearance order. innerjoin enumerates all matches then stable sorts by left keys. join rejects any duplicate right key before scanning left and requires every left row match. combine omits right keys, suffixes colliding names. (bytes 18733–22422)
- **part of:** [mlab-builtins-table](https://md.groupants.elamur.ai/free/en/mova/mlab/src/builtins/table.rs.groupant/)
- **repository folder:** [`mlab/src/builtins/table.rs.groupant/joins.groupant`](https://github.com/ElamurAI/mova-free/tree/main/mlab/src/builtins/table.rs.groupant/joins.groupant)
- **repository commit:** `855da7bd4a7b`

> **Implementation material.** A Mova code model describes this code at one source revision: partial models, finite checks and their stated scope. It is not a reviewed general exposition, and its labels are shown as written, never raised.

## Components

| component | label | where |
|---|---|---|
| **approximant** | partial | [approximant](#approximant) |
| **ast** | partial | `../syntax.json` |
| **cost** | symbolic source derived | [invariant](#invariant) |
| **descriptant** | present | [descriptant](#descriptant) |
| **invariant** | partial | [invariant](#invariant) |
| **tests** | partial bounded parent evidence | [tests](#tests) |

## Obernants

The typed relations around the forward model: the behaviour complement (what the code never does), the reverse reconstruction (every input compatible with an output) and specialised views.

| id | type | label | where |
|---|---|---|---|
| `behavior_complement` | behavior_complement | partial source derived model | [behavior_complement](#behavior-complement) |
| `reverse_reconstruction` | reverse_reconstruction | partial source derived model | [reverse_reconstruction](#reverse-reconstruction) |
| `multiplicity` | multiplicity | partial source derived model | [multiplicity](#multiplicity) |
| `failure_precedence` | failure_precedence | partial source derived model | [failure_precedence](#failure-precedence) |
| `branch_relation` | branch_relation | partial source derived model | [branch_relation](#branch-relation) |
| `resource_cost` | resource_cost | partial source derived model | [resource_cost](#resource-cost) |

## Model text


### descriptant

#### mlab-builtins-table-joins

right_index stores nonmissing key rows in appearance order. innerjoin enumerates all matches then stable sorts by left keys. join rejects any duplicate right key before scanning left and requires every left row match. combine omits right keys, suffixes colliding names.

Epoch 2026-10-31: isolated source-bound fragment over bytes [18733,22422); includes no claim beyond this relation. Source hash f1b0959092cfcdd3cbd171a48d252ce4c1e652b1e56ed030c160e7667d8cbb54.

### approximant

#### joins: forward relation

right_index stores nonmissing key rows in appearance order. innerjoin enumerates all matches then stable sorts by left keys. join rejects any duplicate right key before scanning left and requires every left row match. combine omits right keys, suffixes colliding names.

Domain: Well-shaped values and finite practical windows; effects delegated to it.fs. Physical filesystem not exercised.

Executable surrogate gap: no measured cheaper implementation with a useful scoped metric is supplied. Categorical/error/effect relations are exact obligations, not percent losses. Future numeric caps only1/2/5/10%.

### invariant

#### joins: invariant and cost

innerjoin matches count sums left multiplicity*right multiplicity for each key; strict join enforces right<=1 globally.

Duplicate nonmissing right keys fail before first unmatched left; missing right rows never enter map.

Scope-specific cost: Expected O(nr*k + nl*k + m) hash match construction; innerjoin adds O(m log m*k) stable ordering and O(m*w) result materialization. Duplicates may make m=nl*nr.

### models

### behavior_complement

No NaN/None key matches. join excludes partial unmatched output and does not guarantee valid unique final names after suffix collisions.

### reverse_reconstruction

Joined values admit multiple original unmatched rows and duplicate multiplicities; explicit source indices absent, so inverse is a relation. strict join admits right rows unused by left.

### multiplicity

innerjoin matches count sums left multiplicity*right multiplicity for each key; strict join enforces right<=1 globally.

### failure_precedence

Duplicate nonmissing right keys fail before first unmatched left; missing right rows never enter map.

### branch_relation

right_index stores nonmissing key rows in appearance order. innerjoin enumerates all matches then stable sorts by left keys. join rejects any duplicate right key before scanning left and requires every left row match. combine omits right keys, suffixes colliding names.

### resource_cost

Expected O(nr*k + nl*k + m) hash match construction; innerjoin adds O(m log m*k) stable ordering and O(m*w) result materialization. Duplicates may make m=nl*nr.

### tests

#### Evidence boundary

See ../tests.md for the actual selected source test and mutant. These tests sample the file, not every fragment branch. No NaN/None key matches. join excludes partial unmatched output and does not guarantee valid unique final names after suffix collisions. Other branches here are source-derived and unexecuted unless the parent test explicitly calls them.
