Why Joins Are Expensive

Joins are a costly database operation because they require creation of a cartesian product in memory. This means that a virtual table is created in memory that has a number of rows that is a multiplication of the number of rows from all the tables that you are joining.

Is self join efficient?

While self-joins do indeed have their place, and can be very powerful and useful, often times there is a much easier and more efficient way to get the results you need when querying a single table. This can be extended to find any number of matching values, and we can even put them in a table and JOIN to it.

Why is self join required?

You use self-join to create a result set that joins the rows with the other rows within the same table. Because you cannot refer to the same table more than one in a query, you need to use a table alias to assign the table a different name when you use self-join.

Alexander Ross

Alexander Ross

Gaming, Esports & Interactive Media Writer

Alexander Ross has covered the video game industry for a decade, writing deep dives on game design, esports tournaments, VR developments, and gaming culture.

Share this article
Twitter Facebook Pinterest