database 有损分解

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/12671362/
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

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-08 08:44:11  来源:igfitidea点击:

lossy decomposition

databasedatabase-normalization

提问by user1710986

Why a lossy decomposition is called lossy ? What exactly we loss in a lossy decomposition?

为什么有损分解称为有损分解?我们在有损分解中究竟损失了什么?

There is a relation R. It is decomposed into two relation R1 and R2.

有一个关系R。它被分解成两个关系R1和R2。

if R = (R1 JOIN R2) then it is losless join decomposition.It is alright.

如果 R = (R1 JOIN R2) 那么就是无损连接分解。没关系。

if R is a subset of (R1 JOIN R2) then lossy join decomposition.

如果 R 是 (R1 JOIN R2) 的子集,则有损连接分解。

Here is lossy join decomposition, after join R1 and R2 we are actually getting more records compare to R. So what are we losing. ?

这是有损连接分解,在连接 R1 和 R2 之后,与 R 相比,我们实际上获得了更多的记录。那么我们失去了什么。?

回答by ithinkisam

Since we are dealing with some instance, R, the relation contains a fixed number of records. It also implicitly contains information about which records do not exist. If the join of R1 and R2 produce extra records, we lose informational integrity.

由于我们正在处理某个实例 R,因此该关系包含固定数量的记录。它还隐含地包含有关哪些记录不存在的信息。如果 R1 和 R2 的连接产生额外的记录,我们就会失去信息完整性。

Suppose you were using the following relation R = (SSN, Name, Address):

假设您使用以下关系 R = (SSN, Name, Address):

           R
SSN     Name      Address
1111    Joe       1 Pine
2222    Alice     2 Oak
3333    Alice     3 Pine

Let R1 = (SSN, Name) and R2 = (Name, Address).

让 R1 = (SSN, Name) 和 R2 = (Name, Address)。

     R1                     R2
SSN     Name     |     Name    Address
1111    Joe      |     Joe     1 Pine
2222    Alice    |     Alice   2 Oak
3333    Alice    |     Alice   3 Pine

The join of R1 and R2 would produce the following table:

R1 和 R2 的连接将产生下表:

       R1 join R2
SSN     Name      Address
1111    Joe       1 Pine
2222    Alice     2 Oak
2222    Alice     3 Pine
3333    Alice     2 Oak
3333    Alice     3 Pine

The information lost in this example is the address for person 2222 and 3333. In the original relation, R, person 2222 lives at 2 Oak. In the join of R1 and R2, person 2222 either lives at 2 Oak or 3 Pine--we no longer have this information.

此示例中丢失的信息是人员 2222 和 3333 的地址。在原始关系 R 中,人员 2222 住在 2 Oak。在 R1 和 R2 的连接中,人 2222 要么住在 2 Oak 或 3 Pine——我们不再有这些信息。

This is how extra information can result in a lossy decomposition. The recordswere not lost--what we lost was informationabout which records were in the original relation.

这就是额外信息如何导致有损分解。该记录中没有丢失-我们失去了什么是信息有关哪些记录在原始关系。