1 / 11

Computing Canonical Cover

Computing Canonical Cover. Souhad M. Daraghma. Canonical Cover. A canonical cover for F is a set of dependencies F c such that F logically implies all dependencies in F c, and F c logically implies all dependencies in F, and

lexiss
Download Presentation

Computing Canonical Cover

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Computing Canonical Cover Souhad M. Daraghma

  2. Canonical Cover • A canonical coverfor F is a set of dependencies Fc such that • F logically implies all dependencies in Fc, and • Fc logically implies all dependencies in F, and • No functional dependency in Fccontains an extraneous attribute, and • Each left side of functional dependency in Fcis unique • Intuitively, a canonical cover of F is a “minimal” set of functional dependencies equivalent to F, having no redundant dependencies or redundant parts of dependencies

  3. Extraneous Attributes • Consider F, and a functional dependency, A  B. • “Extraneous”: Are there any attributes in A or B that can be safely removed ? • Without changing the constraints implied by F

  4. Testing if an Attribute is Extraneous • Consider a set F of functional dependencies and the functional dependency   in F. • To test if attribute A   is extraneousin • compute ({} – A)+ using the dependencies in F • check that ({} – A)+ contains A; if it does, A is extraneous • To test if attribute A  is extraneous in  • compute + using only the dependencies in F’ = (F – {})  {(– A)}, • check that + contains A; if it does, A is extraneous

  5. Computing Canonical Cover R = {A,B,C,D,E,F,G,H} F = {ACG, DEG, BCD, CGBD, ACDB, CEAG} Find the canonical cover of F. 1. Union 2. Find a redundant (extraneous) attribute Consider ACDB, Dis extraneous, because ACG and CGBD imply AC  CGB So change ACDB into ACB {ACG, DEG, BCD, CGBD, ACB, CEAG}

  6. Computing Canonical Cover {ACG, DEG, BCD, CGBD, ACB, CEAG} 1. Union {ACBG, DEG, BCD, CGBD, CEAG} 2. Find a redundant (extraneous) attribute Consider ACBG, G is extraneous, because ACB, BCD, and DEG imply AC D G So change ACBG into ACB {ACB, DEG, BCD, CGBD, CEAG}

  7. Computing Canonical Cover {ACB, DEG, BCD, CGBD, CEAG} 1. Union 2. Find a redundant (extraneous) attribute Consider CGBD, B is extraneous, because CGD, D EG, CEAG, and AC B imply CG CD  CE  AC  B So change CG BD into CG D {ACB, DEG, BCD, CGD, CEAG}

  8. Compute Canonical Cover {ACB, DEG, BCD, CGD, CEAG} 1. Union 2. Find a redundant (extraneous) attribute Consider CE AG, G is extraneous, because CE A, AC B, BCD, and D EG imply CE  AC  BC  D G So change CE  AG into CE  A {ACB, DEG, BCD, CGD, CEA}

  9. Compute Canonical Cover {ACB, DEG, BCD, CGD, CEA} No more extraneous attributes FC ={ACB, DEG, BCD, CGD, CEA} * Different order of considering the extraneous attributes can result in different FC

  10. Example2: Computing a Canonical Cover • R = (A, B, C)F = {A BC B C A BABC} • Combine A BC and A B into A BC • Set is now {A  BC, B  C, AB  C} • A is extraneous in ABC • Check if the result of deleting A from AB  C is implied by the other dependencies • Yes: in fact, BC is already present! • Set is now {A  BC, B  C} • C is extraneous in ABC • Check if A  C is logically implied by A  B and the other dependencies • Yes: using transitivity on A B and B  C. • Can use attribute closure of A in more complex cases • The canonical cover is: A B B C

  11. Example3: Computing a Canonical Cover • Given F = {AC, ABC } • B is extraneous in AB C because {AC, AB C} is equivalent to {AC, AC } = {AC} • Given F = {AC, ABCD} • C is extraneous in ABCD because {AC, ABCD} is equivalent to {AC, ABD}

More Related