joinCardinality
joinCardinalityEstimate the output size and selectivity of an equi-join between two tables without executing it. Returns planner estimates for both sides and versus the Cartesian product to assess join cost.
Instructions
Estimate the output size and selectivity of a proposed equi-join between two known tables without executing it. Returns planner estimates for both sides and versus the Cartesian product; use findJoinPaths when the join route itself is unknown.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| toTable | Yes | ||
| joinType | No | Join type: INNER (default), LEFT, RIGHT, FULL | |
| toSchema | No | ||
| fromTable | Yes | ||
| connection | Yes | Database to run against. Call listConnections for valid names; do not guess. | |
| fromSchema | No | ||
| leftColumn | Yes | Column in fromTable. | |
| rightColumn | Yes | Column in toTable. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| note | No | Additional context about support, limits, interpretation, or engine-specific behavior. | |
| toTable | No | Right or joined target table for the join estimate. | |
| joinType | No | Join type used for the estimate or parsed join, such as INNER, LEFT, RIGHT, or FULL. | |
| toSchema | No | ||
| fromTable | No | Left or preserved source table for the join estimate. | |
| fromSchema | No | ||
| leftColumn | No | Column from the source table used on the left side of the join estimate. | |
| rightColumn | No | Column from the target table used on the right side of the join estimate. | |
| cartesianRows | No | Product of the two side row estimates before applying join selectivity. | |
| estimatedRows | No | Planner or catalog estimate of rows for this object or operation. | |
| toRowEstimate | No | Planner row estimate for the target table before joining. | |
| fromRowEstimate | No | Planner row estimate for the source table before joining. | |
| selectivityVsCartesian | No | Estimated join output divided by cartesian row count, from 0.0 to 1.0 when known. |