Laws involving σ
Laws involving
σ:
- σC1 and C2(R)
- σC1 or C2(R)
- σCond(R1 ∪ R2))
- σCond(R1 ∩ R2))
- σCond(R1 − R2))
- σCond(R1 × R2))
- σCond(R1 ⋈ R2))
|
Comment:
the conditions
only contain
attributes from
one relation
σ
C1 and C2
(R)
Comment on Algebraic Laws: direction
Comment:
σ
C1 or C2
(R) -
valid for set union
Bag union (RHS)
result may contain
duplicates
σ
Cond
(R ∪ S)
Comment:
performing the
selection σ
earlier may
reduce the
input size or
allow use to use index scan
σ
Cond
(R − S)
Note:
the sets R and S but have
same structure to perform
subtraction (−)
Comment:
performing the
selection σ
earlier may
reduce the
input size or
allow use to use index scan
σ
Cond
(R ∩ S)
Comment:
performing the
selection σ
earlier may
reduce the
input size or
allow use to use index scan
Combining
(1)
σ
C1 and C2
(R)
and
(2)
σ
Cond
(R ∩ S)
σ
Cond
(R × S) -
with Cond containing
only attributes from R or S
Comment:
performing the
selection σ
earlier may
reduce the
input size or
allow use to use index scan
Note:
a more useful law on
σ and
× will
be discussed in next webpage
σ
Cond
(R ⋈ S) -
with Cond containing
only attributes from R or S
Comment:
performing the
selection σ
earlier may
reduce the
input size or
allow use to use index scan
σ
Cond
(R ⋈ S) -
with Cond containing
only attributes from R or S
-
Example
Clearly:
performing the
selection σ
earlier may
reduce the
input size or
allow use to use index scan
Combining
(1)
σ
C1 and C2
(R)
and
(2)
σ
Cond
(R ⋈ S)
❮
❯