证明无损或有损分解 [英] Proving Lossless or Lossy Decomposition

查看:100
本文介绍了证明无损或有损分解的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图解决一个有关证明给定分解是有损还是无损的问题

I was trying to solve a question regarding proving whether the given decomposition is lossy or lossless

通过应用测试无损连接属性.F = {AB→C,C→E,B→D,E→A}是功能依赖项的集合在R上一世.R(ABCDE)分解为R1(AB),R2(ADE)和R3(BCD)ii.R(ABCDE)分解为R1(BCD),R2(ACE)和R3(BD)

**

  • 我对解决方案的尝试:

**

仅当给定表之间具有公共属性并且公共属性是候选键/超级键时,分解才能是无损的.

A decomposition can only be lossless if there are common attributes between the given tables and the common attributes are candidate key/super key.

在第一部分中,R1中没有候选密钥,R2中没有候选密钥,因此我们可以将其称为有损分解吗?

In the first part, we have no candidate key in R1 and none in R2 so can we call it as lossy decomposition ?

在第二部分中,C是R2的候选密钥,B是R3的候选密钥,但是R1没有密钥,并且R2和R3没有共享公共属性,因此它也不是无损分解的吗?

In the second part, C is the candidate key for R2 and B is the candidate key for R3, but R1 has no key and also R2 and R3 share no common attributes so its also not a lossless decomposition ?

我的解释是否正确?或者还有其他标准吗?

Is my explanation valid or are there any more criteria ?

推荐答案

说明很明确:通过对无损连接属性应用测试".大概这就是一个重要的定理,它表示当/iff ...时,二进制连接/分解是无损的.但是您不必引用它.看你的课本.(请注意,Wikipedia的文章有问题.)您确实说过如果没有则只能是无损的",但这只是说有必要,这是一个方向上的如果",而您还没有说什么也足够,那就是另一个方向上的"if",这是您需要的方向,因此您的推理不正确-除非您只是使用较差的语言并且您的意思是"iff".但是,即使使用"iff",您的定义也是错误的.您需要说公共列构成了至少一个组件的超键" .而且,之间存在公共属性"不属于任何属性,无论联接是否无损,都不需要具有公共属性.没有通用属性意味着通用属性集{}和交叉连接;但是,如果其子集{}是组件的CK(该组件最多具有一行),则联接是无损的.另外,还需要告诉您F是封面,然后告诉我们-或找不到CK.另一个问题是我们没有CK"(每个模式都有一个CK,因为所有列的集合都构成一个超键),并且总是有琐碎的FD.必须使用定义,定理&查找CK的算法.另外,您还需要找到您获得的封皮封盖的所有FD.然后使用其中包含所有属性的FD为每个组件计算新的CK.还有另一个定理说,闭包的FD恰好是组件中容纳的FD.可能存在给定&所隐含的FD.即使给定的属性都没有,也可以将它们的所有属性都包含在一个组件中.--但是您不需要知道,您只需要通过使用定义,定理和定理来证明您拥有FD,就可以证明您拥有CK.算法.但是属性"定理也涉及到 binary 分解-那么您是否被告知要假设但不告诉我们R = R1 JOIN(R2 JOIN R3)的顺序?从定理&中可以清楚地看出.算法和FD,封盖,封口和封口的定义CK,但您需要记住定义&完全定理&然后精确地应用它们乏味的.这就是我刚刚做的.

The instructions are clear: "by applying the test for lossless join property". Presumably that is the important theorem that says that a binary join/decomposition is lossless when/iff .... But you don't quote it. Look in your textbook. (Beware, the Wikipedia article has problems.) You do say "can only be lossless if" but that's just saying something is necessary, which is the "if" in one direction, whereas you haven't said what's also sufficient, which is the "if" in the other direction, which is the direction you need, so your reasoning is not sound--unless you are just using poor language and you mean "iff". But even using "iff" your definition is wrong. You need to say that "the common columns form a superkey" of at least one of the components. And "there are common attributes between" doesn't belong--there don't need to be common attributes whether or not a join is lossless. No common attributes means a common attribute set {} and a cross join; but if its subset {} is a CK of a component--that component has at most one row--the join is lossless.--But you don't need to know that, you just have to use the theorem. Also you need to be told F is a cover--then tell us--or CKs can't be found. Another problem is "we have no CK"--every schema has a CK, since the set of all columns forms a superkey--and there are always the trivial FDs.--But you don't need to know that, you just have to use the definitions, theorems & algorithms for finding CKs. Also you need to find all the FDs of the closure of the cover you were given & then calculate the new CKs for each component using the FDs that have all their attributes in it. There's another theorem that says that those FDs of the closure are exactly the FDs that hold in the components. There could be FDs that are implied by the given ones & have all their attributes in a component even though the given ones don't.--But you don't need to know that, you just need to justify you have the CKs by justifying you have the FDs by using definitions, theorems & algorithms. But also the "property" theorem involves binary decompositions--so have you been told to assume--but not told us--that R = R1 JOIN (R2 JOIN R3) in that order? This is all clear from the theorems & algorithms & definitions of FD, cover, closure & CK but you need to memorize definitions & theorems exactly & then apply them precisely & tediously. That's all I just did.

为什么您对这两个部分的问题有疑问?为什么不应用属性"定理?您为什么不解决有关二进制连接的事实呢?

Why do you have doubts in your questions in the 2 parts? Why are you not applying the "property" theorem? Why are you not addressing the fact that it is about binary joins?

如果您不确定如何做在教科书中看到的练习,并且知道自己不需要创造力,那么您实际上就不知道自己在做什么,因此请回到教科书中.找出答案.

If you are ever unsure of how to do an exercise that you have seen in your textbook that you know doesn't require creativity then you literally don't know what you are doing so go back in your textbook & find out.

通常,我会用以下评论结束像这样的投票问题:

Usually I just close vote questions like this with this comment:

关于这是对的"的回答:请根据参考资料/教科书合理地展示您的工作步骤-您可能会发现使您的问题变得不必要的错误.我们不完全知道您要采用哪种算法&我们想检查您的工作,但不重做&当算法允许时,我们需要您的选择&否则我们无法告诉您您去对错了&我们不想重写您的教科书.请参阅如何提问,在Google搜索"stackexchange homework"和投票箭头鼠标悬停在文本上.

Re "is this right": Show the steps of your work following your reference/textbook, with justification--you may find mistakes that make your question unnecessary & we don't know exactly what algorithm you are following & we want to check your work but not redo it & we need your choices when an algorithm allows them & otherwise we can't tell you where you went right or wrong & we don't want to rewrite your textbook. Please see How to Ask, hits googling 'stackexchange homework' & the voting arrow mouseover texts.

通常,当我在引用的数据库规范化作业中看到良好的F或其他FD集合或列表时,没有任何解释时,我会尝试通过评论以下内容的变体来解决问题:

Usually when I see good ol' F or other set or list of FDs in a quoted database normalization assignment without explanation I try to work towards an answerable post by commenting a variant of this:

我有这些FD"是什么意思?所有这些FD都持有"?-不可能.这些都是持有的非平凡的FD"吗?-不可能.这是一些持有的FD"吗?-无法回答问题.找出什么是封面&应用特定定义/规则/算法的确切条件是什么?确定CK和我们必须给NF提供覆盖的FD.有时覆盖率极低/无法还原.并且必须提供所有属性的集合.查看此答案.

What does "I have these FDs" mean? "These are all the FDs that hold"?--Not possible. "These are all the non-trivial FDs that hold"?--Not possible. "These are some FDs that hold"?--Question can't be answered. Find out what a cover is & what the exact conditions are to apply a particular definition/rule/algorithm. To determine CKs & NFs we must be given FDs that form a cover. Sometimes a minimal/irreducible cover. And the set of all attributes must given. See this answer.

因此,当您重做此练习时,如果不确定您会在什么时候知道该怎么做,发表另一个问题,请确保遵循这些评论.

So when you redo this exercise, if you're not certain you know what to do at some point & post another question please be sure to follow those comments.

这篇关于证明无损或有损分解的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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