依存关系 [英] Dependency preserving

查看:114
本文介绍了依存关系的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

因此,我正在查看我的数据库注释和资料,以使自己对即将到来的采访的一般概念和术语有所了解。但是,我一直陷于依赖和无损联接分解中。我到处搜索,看到很多数学方程式,但是我正在寻找简单明了的英语答案或示例。

So I am looking over my database notes and material trying to refresh myself on the general concepts and terminology for upcoming interviews. I have gotten stuck at dependency however and lossless-join decompositions though. I have searched all over and see lots of mathy equations but I am looking for a plain and simple English response or example.

我从 http://www.cs.kent.edu/~jin/DM09Fall/lecture6.ppt 说明了我无法完全理解的示例。

I have a found a powerpoint from http://www.cs.kent.edu/~jin/DM09Fall/lecture6.ppt which illustrates an example that I cannot fully understand. It is posted below.

R = (A, B, C)F = {A → B, B → C)
Can be decomposed in two different ways
R1 = (A, B),   R2 = (B, C)
Lossless-join decomposition:
         R1 ∩ R2 = {B} and B → BC
Dependency preserving
R1 = (A, B),   R2 = (A, C)
Lossless-join decomposition:
         R1 ∩ R2 = {A} and A → AB
Not dependency preserving (cannot check B -> C without computing R1 ⋈ R2)

因此,我了解拥有A→B和B→C意味着彼此之间有一个引用,而A→B和A→C意味着B和C之间没有引用或链接。

So I understand that having A → B and B → C means that you have a "reference" in each other, whereas A → B and A → C means there is no reference or link between B and C.

因此,


  1. 无损联接分解意味着整个数据仍在完整?在这两种情况下,您最终仍可以同时获得两个数据,对吗?如果这是错误的,请纠正我! :)

  1. Does Lossless-join decomposition mean that the data overall is still intact? In both scenarios, you can still eventually get both data, right? If this is wrong, please correct me! :)

在第二次分解中,将连接B与C的意义是什么,又如何使它不保持依赖关系?

What is the significance of having that connection B to C in the second decomposition, and how does that make it not dependency preserving?


  • 如果删除A,您将只拥有B和C,而没有任何关系。

  • If A is deleted you will simply have B and C with no relations.

如果删除了B,您仍将拥有A→C。

If B is deleted you will still have A → C.

如果C被删除后,您仍然会有A→B。

If C is deleted you will still have A → B.

因为即使在第一个示例中,删除值后仍然会得到类似的结果。

Because even in the first example you will still end up with similiar results upon deleting values.


  • 如果删除A,您仍然会拥有B→C的关系。

  • If A is deleted you will still have a relation of B → C.


  • 如果删除B,您将只会拥有A和C,而没有关系。

  • If B is deleted you will simply have A and C with no relations.

如果删除C,您将拥有A→B的关系。

If C is deleted you will have a relation of A → B.

无论哪种方式,如果删除每个项目,您仍将具有两个关系实例,而一个两个实例没有关系

So either way, if you delete each item you will still have two instances of a relation and one instance of two items having no relations

我的猜测是,在删除中间人关系(是否有术语)时,示例1中的B和示例2中的A是您仍然可以关联示例1的A→B然后B→C,而在示例2中,您被困在A→B上,而没有连接到A→C。

My guess would be that in deleting the "middle man relation" (is there a term for that), B in example 1 and A in example 2, is that you can still relate example 1's A → B then B → C, while in example 2 you are stuck with A → B with no connection to A → C.

但是,正如您现在看到的,我现在回到为什么会导致数据依赖的地方,而在搜索什么是数据依赖或数据依赖的示例时,它根本不是对我来说毫无意义。

But as you can see I am now back to square one as to why this causes data dependency and while googling "what is data dependency" or "examples of data dependency" it is simply not making any sense to me.

如果有人可以为我澄清这一点,将不胜感激。

If anyone could help clarify this for me it would be greatly appreciated.

推荐答案

无损联接并不意味着任何元组都会丢失,或者联接后无法恢复。无损连接意味着生成虚假元组,从而导致额外行(元组)和信息丢失。

Lossless Join doesn't mean that any of the tuples are lost, or cannot be recovered after a join. Lossless join means generation of spurious tuples which lead to "extra" rows (tuples) and "information" is said to be lost.

简单地说,我认为保留了依赖性当我们在一个子模式的属性中找到FD的两端时。 (如果我错了,请纠正我)。

Putting it simply I think dependency is preserved when we find both sides of the FD in the attributes of one sub-schema. (someone please correct me if I'm wrong).

这篇关于依存关系的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆