系统服务添加依存关系_依存关系分解| 数据库管理系统

本文讨论了系统服务的依赖关系分解,特别是在数据库管理的上下文中。它解释了如何通过保持功能依赖性来分解关系,以实现无损分解,并通过示例说明了关系从2NF到3NF的转换过程。同时,它还阐述了如何确定分解是否保留依赖性。
摘要由CSDN通过智能技术生成

系统服务添加依存关系

A Dependency preserving decomposition of a relation R is R1, R2, R3...Rn concerning the set of Functional Dependencies FD if,

关系R的保持依赖性的分解是关于功能依赖性FD的集合的R1,R2,R3 ... Rn,如果,

 (FD1 ∪ FD2 ∪ ... ∪ FDn)+ = FD+ 

where,

哪里,

  • FD1, FD2, FD3…...FDn Sets of Functional dependencies of relations R1, R2, R3 ...Rn.

    FD1,FD2,FD3 ...... FDn关系R1,R2,R3 ... Rn的功能依赖关系集。

  • (FD1 U FD2 U FD3 U … U FDn)+ -> Closure of Union of all sets of functional dependencies.

    (FD1 U FD2 U FD3 U…U FDn)+->关闭所有功能依赖集的并集。

  • FD+ -> Closure of set of functional dependency FD of R. 

    FD +->关闭R的功能依赖关系FD集。

With FD (FD1) R is decomposed or divided into R1 and with FD(FD2) into R2, then the possibility of three cases arise,

在FD(FD1)的情况下,R被分解或划分为R1,而在FD(FD2)的情况下被分解为R2,则可能出现三种情况

    FD1 ∪ FD2 = FD -> Decomposition is dependency preserving. 
    FD1 ∪ FD2 is a subset of FD -> Not Dependency preserving.
    FD1 ∪ FD2 is a superset of FD -> This case is not possible. 

For the lossless dependency preserving decomposition, the closure of the set of functional dependencies of discrete relations R1, R2, R3 ...Rn should be equal to the set of functional dependencies of the main relation R before decomposition.

为了保持无损相关性分解,离散关系R1,R2,R3 ... Rn的功能相关性集合的闭包应等于分解前主要关系R的功能相关性集合。

Dependency preservation and Normalization process, both concepts works on some similarity. As in Normalization process, to change the form of a relationship into a higher normal form, the solution is by decomposing the relation into two or more relations, which is done by using the set of functional dependencies associated in the lower normal form state.

依赖项保留和规范化过程,这两个概念在某些相似性上起作用。 与在规范化过程中一样,要将关系的形式更改为较高的标准形式,解决方案是将关系分解为两个或更多个关系,这是通过使用在较低的标准形式状态下关联的一组功能依赖项来完成的。

For example:

例如:

Let suppose a relation R (P, Q, R, S) with a set of functional dependency FD = (P→Q, Q→R, R→S).

假设具有一组功能依赖关系FD =(P→Q,Q→R,R→S)的关系R(P,Q,R,S)。

In the given set FD, there is no partial dependency. As a consequence, this relation is in 2NF.

在给定集合FD中,没有部分依赖性。 结果,该关系为2NF。

The relation R (P, Q, R, S) is not in 3NF because of Transitive Functional Dependency. To convert this relation R (P, Q, R, S) into 3NF, the solution which is preferred is decomposition.

由于传递功能依赖性,关系R(P,Q,R,S)不在3NF中。 为了将该关系R(P,Q,R,S)转换为3NF,优选的解决方案是分解。

Q) Let suppose, a relation R (P, Q, R, S) with a set of Functional Dependency FD = (PQ→R, R→S, S→P) is given. Into R1 (P, Q, R) and R2(R, S), relation R (P, Q, R, S) is decomposed. Find out whether the decomposition is dependency preserving or not.

Q)假设给出具有一组功能依赖关系FD =(PQ→R,R→S,S→P)的关系R(P,Q,R,S)。 将关系R(P,Q,R,S)分解为R1(P,Q,R)和R2(R,S)。 找出分解是否保留依赖项。

Solution:

解:

Decomposed relations of relation R (P, Q, R, S) are R1 (P, Q, R) and R2 (R, S). To solve this problem, we need to first find the closure of Functional Dependencies FD1 and FD2 of the relations R1 (P, Q, R) and R2(R, S).

关系R(P,Q,R,S)的分解关系为R1(P,Q,R)和R2(R,S)。 为了解决这个问题,我们首先需要找到关系R1(P,Q,R)和R2(R,S)的功能依赖关系FD1和FD2的闭包。

1) To find the closure of FD1, we have to consider all combinations of (P, Q, R). i.e., we need to find out the closure of P, Q, R, PQ, QR, and RP.

1)要找到FD1的闭包,我们必须考虑(P,Q,R)的所有组合。 即,我们需要找出P,Q,R,PQ,QR和RP的闭合。

    closure (P) = {P} // Trivial
    closure (Q) = {Q}  // Trivial
    closure (R) = {R, P, S} //but S can't be in closure as S is not 
                            //present in R1 (P, Q, R).
                = {R, P}
    (R--> P // Removing R from right side as it is trivial attribute)
    closure (PQ) = {P, Q, R, S}
                = {P, Q, R}
    (PQ --> R // Removing PQ from right side as these are trivial attributes)
    closure (QR) = {Q, R, S, P}
                = {P, Q, R}
    (QR --> P // Removing QR from right side as these are trivial attributes)
    Closure (PR) = {P, R, S}
    (PR --> S // Removing PR from right side as these are trivial attributes)
    FD1 {R --> P, PQ --> R, QR --> P}.

2) Similarly FD2 {R--> S}

2)同样是FD2 {R-> S}

In the original Relation Dependency FD= {PQ→R, R→S, S→P}.

在原始关系依赖关系中,FD = {PQ→R,R→S,S→P}。

    PQ --> R is present in FD1.
    R --> S is present in FD2.
    S --> P is not preserved.

From the given result, in FD1, PQ holds R (PQ --> R) and in FD2, R holds S (R --> S). But, there is no follow up in Functional Dependency S holds P (S --> P).

根据给定的结果,在FD1中,PQ保持R(PQ-> R),在FD2中,R保持S(R-> S)。 但是,在功能依赖性S保持P(S-> P)方面没有后续措施。

FD1 U FD2 is a subset of FD.

FD1 U FD2是FD的子集。

So as a consequence, given decomposition is not dependency preserving.

因此,结果是,给定的分解不是依赖关系的保留。

翻译自: https://www.includehelp.com/dbms/dependency-preserving-decomposition.aspx

系统服务添加依存关系

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值