Slideshow:
Example:
|
(2) πfname,lname(employee⋈ssn=essnδ(πessn(dependent))) |
will produce a (much) smaller number of tuples as intermediate result set(s):
Furthermore, there exists (space and time) efficient algorithms for join (⋈).
(The only viable algorithm to compute the cartesian product (×) on a large input relation is the nested loop algorithm which is not time efficient)
|
|
The fact that query optimization is NP-complete means that we do not have (right now) any efficient way to find a solution (= optimal query plan)
|
For practical purposes, we try to find a near optimal query plan using some heuristics