Data join cardinality forecast calculator

Enter the union of keys, using zero for absent keys; null matching follows your preprocessing policy.

Your inputs

Separate numbers with commas or spaces.
Input format

Use this format with your own values:

2,3,0
Separate numbers with commas or spaces.
Input format

Use this format with your own values:

4,0,5

Use the units shown.

Inner join rows (count)
8
Left join rows (count)
11
Full outer join rows (count)
16

Your calculation
How is this calculated?

Multiply left and right frequencies for every key and sum.

Each left row matches the right count or emits one unmatched row.

Use products for matched keys and original counts for unmatched keys.

Enter the union of keys, using zero for absent keys; null matching follows your preprocessing policy. Counts are key frequencies, not raw records.

PostgreSQL Table Expressions — Joined Tables ↗

Try an example

Worked example

Inner join rows (count): 8

Inputs
  • Left rows per aligned key (counts): 2,3,0
  • Right rows per aligned key (counts): 4,0,5

Compare inputs

Inner join rows (count): 8

Inputs
  • Left rows per aligned key (counts): 2,3,0
  • Right rows per aligned key (counts): 1,2,0
Share this page
Share this calculator

Leave unchecked to share the page without your entered values.