Cartesian product
Every possible pairing of one item from each of two sets, so the number of pairs is the product of the two sizes.
In more detail
For sets of sizes m and n it contains m times n pairs, so three values times two values gives six pairs. In SQL, a join with a missing or incomplete join condition produces an accidental Cartesian product, which quietly multiplies sums and averages instead of failing. Build systems use the same idea to expand a matrix of settings into one job per combination.
Related terms
- strategy matrix — A job setting that expands one job description into one job for every combination of the listed values.
- CROSS JOIN — A join with no pairing rule, which pairs every row of one table with every row of the other.
- ON clause — The part of a join that states which rows of the two tables belong together.
- comma join — The old join syntax that lists tables separated by commas in FROM and puts the pairing rule in WHERE.
Taught in
- Scaling with Matrix Builds — Continuous Integration & Continuous Delivery Pipelines
- Matrices, Needs And Concurrency: The Shape Of A Run — GitHub Actions (GH-200) Exam Prep
- YAML-Reading Sprint: What Happens When This Runs? — GitHub Actions (GH-200) Exam Prep
- Cross Joins And Cartesian Bugs — PostgreSQL, Indexing & Relational Data Modeling
- Grouping By Multiple Columns — PostgreSQL, Indexing & Relational Data Modeling