EQUIVALENCE RULES IN DBMS
1. Conjunctive selection operations can be deconstructed into a sequence of individual selections. This transformation is referred to as a cascade of σ.
2. Selection operations are commutative.
3. Only the final operations in a sequence of projection operations are needed, the others can be omitted. This transformation can also be referred to as a cascade of Π.
4. Selections can be combined with Cartesian products and theta joins.
a.
This expression is just the definition of the theta join.
b.
5. Theta-join operations are commutative.
Actually, the order of attributes differs between the left-hand side and the righthand side, so the equivalence does not hold if the order of attributes is taken into account. A projection operation can be added to one of the sides of the equivalence to appropriately reorder attributes, but for simplicity, we omit the projection and ignore the attribute order in most of our examples.
6. a. Natural-join operations are associative.
b. Theta joins are associative in the following manner:
where θ2 involves attributes from only E2 and E3. Any of these conditions may be empty; hence, it follows that the Cartesian product (×) operation is also associative. The commutativity and associativity of join operations are important to join reordering in query optimization.
7. The selection operation distributes over the theta-join operation under the following two conditions:
a. It distributes when all the attributes in selection condition θ0 involve only the attributes of one of the expressions (say, E1) being joined.
b. It distributes when selection condition θ1 involves only the attributes of E1 and θ2 involve only the attributes of E2.
8. The projection operation distributes over the theta-join operation under the following conditions.
a. Let L1 and L2 be attributes of E1 and E2, respectively. Suppose that the join condition θ involves only attributes in L1 ∪ L2. Then,
b. Consider a join E1 θ E2. Let L1 and L2 be sets of attributes from E1 and E2, respectively. Let L3 be attributes of E1 that are involved in join condition θ, but are not in L1 ∪ L2, and let L4 be attributes of E2 that are involved in join condition θ, but are not in L1 ∪ L2. Then,
9. The set operations union and intersection are commutative.
The set difference is not commutative.
10. Set union and intersection are associative.
11. The selection operation distributes over the union, intersection, and set– difference operations.
The preceding equivalence, with − replaced by ∩, also holds, but does not hold if − is replaced by ∪.
12. The projection operation distributes over the union operation.
0 Comments
Doubts? Please let our team know So that we can serve you better.