Consider the following query:
Query 2:
SELECT c.RegNo, c.model, c.year, o.NIC
FROM cars c, owner o
WHERE c.RegNo=o.RegNo and year =2017 and price <6000000
1. Assume there are no indexes available on either table. If the join algorithm used is block nested loops join, draw the extended query plan for Query 2.
2. Calculate the cost of executing Query 2 using the plan designed in question 2. Show the steps in the calculation.
3. If the join algorithm used is Index nested loops join, what are indexes needed in order to have an optimal plan for Query 2?
4. Draw the extended query plan for Query 2 using identified indexes in question 4.
5. Calculate the cost of executing Query 2 using the plan designed in question 5. Show the steps in the calculation
Comments
Leave a comment