Relational Operator - Cross Product

1 - About

The set cartesian product applied to a set of row (ie a tables) create all pairs of tuples (row).

A cross-join (also called Cartesian join) occurs when a request does not have a join condition between two tables. We say that the inner table is not driven from (not dependent on) the outer table.

That creates a cartesian product of the tables involved in the join. The size of a cartesian product is the number of rows in the first table multiplied by the number of rows in the second table.

In other word, if the inner table's access path is independent of the outer table, then the same rows are retrieved for every iteration of the outer loop.

The cartesian product in named for Rene Descartes.

3 - Symbol

A cross (times) <MATH> \LARGE R1 \times R2 </MATH>


4 - Size

The size of this cross-join is then the size of the first table (R1) multiplied by the size of the second table (R2).

5 - Example

5.1 - Find all pairs of similar images/tweets/songs

5.2 - Sql

Data Science
Data Analysis
Data Science
Linear Algebra Mathematics

Powered by ComboStrap