Cartesian explosion
A Cartesian explosion is an effect that occurs when applying the Cartesian product to multiple sets, which results in geometric growth in the number of outputted combinations.[1]
In database querying
This problem most often occurs in the realm of database querying in languages such as SQL. If a join operator is applied to multiple tables without specifying a join condition (such as a foreign key reference), the resulting data set ends up growing multiplicatively, producing a result that has a row count equal to the product of the row count of all tables involved in the query.[2]
For example, if a Customers table has 5 rows and a Products table has 10 rows, running a naive SQL join query such as SELECT * FROM Customers, Products produces a result that has 5×10 (50) rows: every row in the first table is mapped to every row in the second table. If each table had thousands of rows, then doing this query would result in millions of rows of output, which may have severe performance impacts. If more than two tables are involved in the query, the impact is even more pronounced.
References
- ^ Gulutzan, Peter; Pelzer, Trudy (2003). SQL Performance Tuning. Addison-Wesley. p. 88. ISBN 9780201791693.
- ^ Zagni, Roberto (30 June 2023). Data Engineering with DBT: A Practical Guide to Building a Cloud-Based, Pragmatic, and Dependable Data Platform with SQL. Packt Publishing. p. 28. ISBN 9781803241883.
Content Disclaimer
Informasi ini disarikan dari Wikipedia dan disajikan kembali untuk tujuan edukasi. Konten tersedia di bawah lisensi CC BY-SA 3.0. Kami tidak bertanggung jawab atas ketidakakuratan data yang bersumber dari kontribusi publik tersebut.
- The information displayed on this website is sourced in part or in whole from Wikipedia and has been adapted for the purpose of restating it. We strive to provide accurate and relevant information, however:
- There is no guarantee of absolute accuracy. Wikipedia is an open, collaborative project that can be edited by anyone, so information is subject to change.
- It is not intended to constitute professional advice. The content displayed is for informational and educational purposes only. For important decisions (e.g., medical, legal, or financial), please consult a professional.
- Content copyright. Wikipedia is licensed under the Creative Commons Attribution-ShareAlike License (CC BY-SA). This means that content may be reused with appropriate attribution and shared under a similar license.
- Responsible use. Any risk arising from the use of information from this website is entirely the responsibility of the user.