Review of the Nested-loop Algorithm
Recall the nested-loop
join algorithm:
Review of the Nested-loop Algorithm
Review of
the nested-loop
join algorithm:
Review of the Nested-loop Algorithm
Review of
the nested-loop
join algorithm:
Property of the Nested-loop Algorithm
Property of
the nested-loop
join algorithm:
Nested-loop algorithm using non-left-deep trees
may read 1st relation
multiple times
Consider the
nested loop execution using:
Nested-loop algorithm using non-left-deep trees
may read 1st relation
multiple times
Behavior of
nested join algorithm for
the join operator ⋈3:
Nested-loop algorithm using non-left-deep trees
may read 1st relation
multiple times
Behavior of
nested join algorithm for
the join operator ⋈3:
Nested-loop algorithm using non-left-deep trees
may read 1st relation
multiple times
Behavior of
nested join algorithm for
the join operator ⋈3:
Notice that:
the 2nd input "relation"
is
computed !!!
I.e.: we must execute the
operation
again if we
want to obtain the tuples again !!
Nested-loop algorithm using non-left-deep trees
may read 1st relation
multiple times
Behavior of
nested join algorithm for
the join operator ⋈3:
Notice that:
the 2nd input "relation"
is
computed !!!
The execution will
read relation T
once for the
first chunk of
U tuples
Nested-loop algorithm using non-left-deep trees
may read 1st relation
multiple times
Behavior of
nested join algorithm for
the join operator ⋈3:
Nested-loop algorithm using non-left-deep trees
may read 1st relation
multiple times
Behavior of
nested join algorithm for
the join operator ⋈3:
Nested-loop algorithm using non-left-deep trees
may read 1st relation
multiple times
Behavior of
nested join algorithm for
the join operator ⋈3:
Notice the
anomaly in
the behavior of the
nested-loop algorithm:
Nested-loop algorithm using non-left-deep trees
may read 1st relation
multiple times
Behavior of
nested join algorithm for
the join operator ⋈3:
Notice the
anomaly in
the behavior of the
nested-loop algorithm:
(because ⋈2 has been
executed
multiple times
by the query plan!!!)
Nested-loop algorithm using non-left-deep trees
may read 1st relation
multiple times
Summary:
Why left-deep trees work well for the nested-loop join algorithm
Consider the
nested loop execution using:
Why left-deep trees work well for the nested-loop join algorithm
Behavior
of nested join algorithm
for the join operator ⋈1:
Why left-deep trees work well for the nested-loop join algorithm
Behavior
of nested join algorithm
for the join operator ⋈1:
The difference is:
the
right sub-trees
only contain
relations
(i.e.: no operators !!)
Why left-deep trees work well for the nested-loop join algorithm
Behavior
of nested join algorithm
for the join operator ⋈1:
Why left-deep trees work well for the nested-loop join algorithm
Behavior
of nested join algorithm
for the
join operator ⋈2:
The difference again is:
the
right sub-trees
only contain
relations
(i.e.: no operators !!)
Why left-deep trees work well for the nested-loop join algorithm
❮
❯