|
|||||||||||||||||||||||||||||||||||
|
Fan and Chasm TrapsFan traps and chasm traps are a consequence of using in same query combinations of tables with mismatching cardinalities. Since Reverse Snowflake Joins is not aware of foreign keys, it can only warn that something is wrong when aggregations are not from the same table. Chasm traps occur when one table is connected to two or more tables by 1-to-N relationships. This causes multiplication of rows. For example one bad way is to directly try to compare actual sales against sales targets by products.
SELECT Fan traps are caused when joining one table by 1-to-N relationship to a second table that is joined to a third table by another 1-to-N relationship. This again is causing multiplication of rows. For example taking the sum of amounts from the orders table and the count of shipped items from the lineitem table.
SELECT |