简体   繁体   中英

Lossless join decomposition more than two relations

Given a relation, a set of functional dependencies, and it's decomposition into multiple relations (> 2) , is there some method with which to check if this decomposition is lossless or lossy?

For decomposing R into two relations R1 and R2, we check if the intersection of R1 and R2 forms the primary key of either R1 or R2. If it does, then the decomposition is lossless.

Consider the question below, where a relation R,it's FD set and decomposition are given.

在此处输入图片说明

Now, I think this decomposition is lossy...but it's more of an intuition. If I am asked to prove this, I might not be able to. My intuition is based on the fact that the relation pairs R2-R3 , R1-R2 , R1-R4 don't have a common attribute between them, which is prime in either relation of the pair. So a natural join operation across R1, R2, R3 and R4 will produce some rows which were not in the original relation.

But I myself am not sure if this decomposition is lossy or not.. Can someone please help me understand this?

Thanks!

Similar question with a good answer is found here: Lossless Join and Decomposition From Functional Dependencies . Just use the chase/tableau method (:

A binary decomposition is lossless when the common columns are a superkey of one component, ie include a CK (candidate key) of one component. (Not a "prime attribute", ie one that is a member of a CK.) So the following are lossless:

       join        FDs                        CKs
R1 R3  ABCDH       A->B, A->C, D->H, AH->D    AD, AH
R2 R4  CDEH        E->C, D->EH                D
R4 R3  ADEH        D->EH, AH->D               AD, AH

We can now join ABCDH & ADEH losslessly based on either CK of either relation, then join the result with CDEH losslessly based on CK D.

So the decomposition is lossless.

Alternatively we can try decomposing. Try R = R1 JOIN ADEH. We find ADEH's FDs & CKs (which happen to be in the table above). We continue, to see whether we can keep losslessly decompose to get R2, R3 & R4.

For a general algorithm see the Chase .

According to me the decomposition is lossless. If you go with the tables, R1 intersection R3 and R2 intersection R4, it is lossless & it involves all the decomposed tables also. If you go for natural join between R1 & R3 and R2 & R4, you will get back the table R. thanks..

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM