Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Fan trap and chasm trap - Database

Can anyone tell me what is chasm trap? Perhaps fan trap too as I'm not too clear. Also, please provide easy to understand examples (via Chen notations).

My understanding thus far: I understand that Fan trap is M:1:1:M, which suggests the paths between entities is ambiguous.
I understand that. For example, if M represents Student and the other M represents School then it'll be ambiguous because we don't know which student studies at which school (that's what I understood so far).

However, I cannot grasp what is chasm trap.

Also, how can I identify the traps and then fix it?

like image 962
Dembele Avatar asked Jan 14 '13 22:01

Dembele


People also ask

What is chasm trap in database?

Chasm Traps A chasm trap occurs when two "many-to-one” joins converge on a single table, and the query includes measures from both leaf tables. As a result multiple rows are returned from the tables when processing the query.

How do you fix a fan trap in a database?

There are two ways to solve a fan trap problem. Create an alias for the table containing the initial aggregation, then use Detect Contexts (Tools > Detect Contexts) to detect and propose a context for the alias table and a context for the original table. This is the most effective way to solve the fan trap problem.

What is connection trap in database?

Connection traps appear when a pathway between two or more entities is either ambiguous or false existent. Relational databases seem like something straightforward, however, correctly written query may not always lead to a correct result. Try to always specify the lower bound of connection.

What is fan trap with example?

When a “one to many” join linked by another “one to many” join in a serious of tables called as Fan Trap. Like the below example, Customer is having multiple Loan account and each Loan having Multiple Collateral which is “one to Many” & “One to Many” join in a series of tables.


1 Answers

Based on Conolly&Begg:

Fan trap occur in a situation when a model represents relationship between entity types however a path between certain entity occurrences is ambiguous.

Example: (Staff)-1:N-has-1:1-(Division)-1:1-operates-1:N-(Branch) Fan Trap in this model it may be impossible to determine the branch a staff belongs to, in the situation when staff belong to division having more than 1 branches.

Restructuring the model resolves trap (Division)-1:1-operates-1:N-(Branch)-1:1-has-1:N-(Staff) Not Fan Trap

Chasm trap occur when a model suggests relationship between entity types however a path between certain occurrences does not exist.

Example: (Branch)-1:1-has-1:N-(Staff)-0:1-oversees-0:N-(PropertyForRent) Chasm Trap

Because Staff relationship to PropertyForRent is with optional participation (0:1) for staff the path for Branch to PropertyForRent may not exist. Solution to this would be direct relationship between Branch and PropertyForRent with mandatory participation.

like image 166
Vladimir Fadeev Avatar answered Sep 27 '22 20:09

Vladimir Fadeev