database 扇形陷阱和裂缝陷阱 - 数据库
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 
原文地址: http://stackoverflow.com/questions/14328319/
Warning: these are provided under cc-by-sa 4.0 license.  You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Fan trap and chasm trap - Database
提问by Dembele
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).
谁能告诉我什么是鸿沟陷阱?也许风扇陷阱也是因为我不太清楚。另外,请提供易于理解的示例(通过 Chen 符号)。
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).
到目前为止我的理解:我知道 Fan trap 是 M:1:1:M,这表明实体之间的路径是不明确的。
我明白那个。例如,如果 M 代表学生,另一个 M 代表学校,那么它就会模棱两可,因为我们不知道哪个学生在哪个学校学习(这是我目前所理解的)。
However, I cannot grasp what is chasm trap.
然而,我无法理解什么是鸿沟陷阱。
Also, how can I identify the traps and then fix it?
另外,如何识别陷阱然后修复它?
采纳答案by Raj Patel
In simple word, for both the cases (FAN & CHASM) it will produce more line(result sets) than actual. How to identify
简而言之,对于这两种情况(FAN 和 CHASM),它会产生比实际更多的行(结果集)。如何识别
- FAN -> 1-N-Nmeans table relation from one -> many -> many
- CHASM -> N-1-Nmeans one row table to two or more table many relation
- LOOP -> joinall tables and when make loop like circle (In this case we will lose some rows absolutely)
- FAN -> 1-NN表示表关系从一 -> 多 -> 多
- CHASM -> N-1-N表示一个行表到两个或多个表的多关系
- LOOP -> 加入所有表,并在像 circle 一样循环时(在这种情况下,我们绝对会丢失一些行)
Nothing to identify but when you create Universe than we have to keep our eyes open, if you see out of these situation while developing Universe than there will be a problem always. So rectify by applying aliases, context.
没有什么可识别的,但是当您创建宇宙时,我们必须睁大眼睛,如果您在开发宇宙时看到这些情况,那么总会有问题。因此,通过应用别名、上下文来纠正。
Once all problems solved at Universe level than we are good to go for reporting. By practice you will have excellent knowledge.
一旦所有问题都在 Universe 级别得到解决,我们就可以进行报告了。通过实践,您将拥有丰富的知识。
回答by Vladimir Fadeev
Based on Conolly&Begg:
基于 Conolly&Begg:
Fan trapoccur 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)
 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.
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.
示例:(Staff)-1:N-has-1:1-(Division)-1:1-operates-1:N-(Branch)
 在这个模型中,可能无法确定一个员工所属的分支,在员工所属部门超过1个分支机构的情况。
在这个模型中,可能无法确定一个员工所属的分支,在员工所属部门超过1个分支机构的情况。
Restructuring the model resolves trap
(Division)-1:1-operates-1:N-(Branch)-1:1-has-1:N-(Staff)

重构模型解决陷阱(Division)-1:1-operates-1:N-(Branch)-1:1-has-1:N-(Staff)

Chasm trapoccur 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)

示例:(分行)-1:1-has-1:N-(Staff)-0:1-oversees-0:N-(PropertyForRent)

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.
由于员工与 PropertyForRent 的关系是员工的可选参与 (0:1),因此分支到 PropertyForRent 的路径可能不存在。对此的解决方案是在强制参与的情况下在 Branch 和 PropertyForRent 之间建立直接关系。
回答by BO fantrap
I fan trap occurs when three tables joins in a fashion where there realtion to each other is 1 to many way. means table A B and C are in join as .. table A links to table B in one to many and table B to table C relates again one to main way A-->B-->C.
当三个表以一种彼此之间存在一对多方式的方式连接时,就会发生 I fan trap。意味着表 AB 和 C 连接为 .. 表 A 以一对多方式链接到表 B,表 B 到表 C 再次与主要方式 A-->B-->C 关联。

