Chase tableau using known FD's to eliminate rows.
and
| a | b | c1 |
| a1 | b | c |
| a | b | c |
| a | b | c |
| a1 | b | c |
| a | b | c |
Use
| a | b | c |
| a | b | c |
| a | b | c |
| a | b | c |
| a | b | c |
= r, the join was not required.
Algorithm to Chase Tableau [295]
Iterate until no more changes, for each FD
Minimize with Chase [296]
Chase with
| a | b1 | c1 |
| a1 | b1 | c3 |
| a2 | b2 | c3 |
| a2 | b | c2 |
| a | b |
| a | b1 | c3 |
| a1 | b1 | c3 |
| a2 | b2 | c3 |
| a2 | b | c2 |
| a | b |
Chase with
| a | b1 | c3 |
| a | b1 | c3 |
| a | b2 | c3 |
| a | b | c2 |
| a | b |
Minimize with
| a | b | c2 |
| a | b |
Minimize with Chase [297]
Chase with
| a | b1 | c1 |
| a1 | b | c1 |
| a2 | b | c2 |
| a2 | b2 | c |
| a | b | c |
| a | b1 | c1 |
| a1 | b | c1 |
| a2 | b | c1 |
| a2 | b2 | c |
| a | b | c |
Chase with
and with
| a | b1 | c1 |
| a | b | c1 |
| a | b | c1 |
| a | b2 | c |
| a | b | c |
| a | b | c1 |
| a | b | c1 |
| a | b | c1 |
| a | b2 | c |
| a | b | c |
Remove duplicate rows
| a | b | c1 |
| a | b2 | c |
| a | b | c |
Multi-Valued Dependencies [298]
FD's tell us what can NOT be in a relation.
MVD's tell us what MUST be in a relation.
| C | T | H | R | S | G |
| CS101 | deadwood | M9 | 222 | klunk | B |
| CS101 | deadwood | W9 | 333 | klunk | B |
| CS101 | deadwood | F9 | 222 | klunk | B |
| CS101 | deadwood | M9 | 222 | zonker | C |
| CS101 | deadwood | W9 | 333 | zonker | C |
| CS101 | deadwood | F9 | 222 | zonker | C |
Course multidetermines Hour Room:
That is, if you see
CS101,deadwood,M9,222,klunk,B
CS101,deadwood,W9,333,zonker,C
in the relation, then we would expect to find
CS101,deadwood,W9,333,klunk,B
CS101,deadwood,M9,222,zonker,C
which is the case. Note we have just exhanged HR pairs
Optimize Query with FD,MVD Chase [299]
Chase with MVD, expand the table,toggle AC
| A | B | C | D |
| a | b | c1 | d1 |
| a1 | b | c | d2 |
| a | b | c1 | d1 |
| a1 | b | c | d2 |
| a1 | b | c | d1 |
| a | b | c1 | d2 |
Chase with FD and minimize with
| a | b | c | d1 |
| a1 | b | c | d2 |
| a1 | b | c | d1 |
| a | b | c | d2 |
| a | b | c | d1 |
Query Optimization: Expression Trees [300]
Make a tree structure of the relational algebra query.
Find Common Subexpressions [301]
Do not need to do the
operation twice
Find Common Subexpressions [302]
Optimize Algebraic Expression [303]
A database of pilots, examiners and ratings:
rp(P#,PN,BD), re(E#,EN), rt(P#,E#,DT,RG)
`Find pilots that have been given a low rating by Randy and who are based in the same place as some other pilot who has been given a low rating since 1 June.'
Optimize Algebraic Expression [304]
Push down
[305]
Project only needed attributes [306]