Does is matter if we perform
R ⋈ S vs
S ⋈ R ?
The theory says:
Note that
the theory
only says:
the result set of
R ⋈ S is
equal to that of
S ⋈ R
Does is matter if we perform
R ⋈ S vs
S ⋈ R ?
In practice:
Does is matter if we perform
R ⋈ S vs
S ⋈ R ? -
Example
Does is matter if we perform
R ⋈ S vs
S ⋈ R ? -
Example
Consequence of the
asymmetric behavior of
the implementation algorithm(s):
Although:
Terminology: build relation and
scanned relation in
the
one-pass algorithm
One-pass
join algorithm:
Terminology: build relation and
scanned relation in
the
one-pass algorithm
One-pass
join algorithm:
Terminology:
Terminology: first relation and
second relation in
the
nested-loop algorithm
Nested-loop
join algorithm:
Terminology: first relation and
second relation in
the
nested-loop algorithm
Nested-loop
join algorithm:
Terminology:
Choosing the join ordering for R ⋈ S
Choosing the join ordering for R ⋈ S
- Example
Query:
Optimized query plan:
Choosing the join ordering for R ⋈ S
- Example
Query:
After choosing the
best
join ordering:
(We always put the first relation at the
left branch of the join tree)
❮
❯