1. Some other equivalences for union and set difference:
∑P (r1 ∪ r2) = ∑P(r1) ∪P(r2)
∑P(r1 ∪r2)= ∑P(r1)-r2= ∑P(r1)-P(r2)
(r1 ∪r2) ∪r3 = r1 ∪(r2 ∪r3)
r1 ∪r2 = r2 ∪r1
2. Further Optimization
Our text covers only some of the possible operations. (For a more complete list, see Elmasri & Navathe, page 518.)
Also, it makes sense to combine the implementation of various sets of operations in order to reduce the size of intermediate relations:
- Combine projects and selects with a Cartesian product or natural join.
- The idea is to do the selection and/or projection while computing the join.
- This saves computing a large intermediate relation that is going to be subsequently reduced by the select or project anyway.
