Consider the following relations:
- Employees (eno, ename, age, phone)
- Works (eno, dno, hours)
- Departments (dno, dname, location)
Assume that Employees relation consists of 300 pages with 100 tuples per page, Works relation contains 900 pages with 100 tuples per page, and Departments relation contains 300 pages with 100 tuples per page. Assume equal-size fields in each relation and uniform distribution of employees for departments in Works relation.
Consider the following query:
Select e.eno, e.ename, w.hours From Employees e, Works w Where e.eno = w.eno AND w.hours >75
Assume that \(3 \%\) of the tuples in Works satisfy the selection condition of hours \(>75\) and 50 buffer pages are available.
Assume that following indexes exit and a hash index takes \(1.21 / \mathrm{Os}\) and a \(\mathrm{B}+\) tree index takes 3 I/Os to find the rid of a tuple when the key is given.
- Index 1: Unclustered B+ tree index on Workschours, eno>
- Index 2: Unclustered hash index on Employees
- Index 3: Unclustered B+ tree index on Employees
Consider Index Nested Loop Join and Sort Merge Join in choosing an efficient plan for the above query. You may use only the given indexes in considering the best plan.
1. Describe two plans based on each of the above join methods.
2. Show estimations of cost (in disk \(1 / \mathrm{O} \mathrm{s}\) ) for both plans.
Note: For simplicity, you may ignore the cost for storing rids in data entries of indexes in your calculations. Write equations/formulas and sub formulas whenever possible. Marks will be given for each step that is shown in estimation.
We need at least 9 more requests to produce the answer.
1 / 10 have requested this problem solution
The more requests, the faster the answer.
Question 1 (5 marks) Consider two relations called Item and Orderltem. Imagine that relation Item has 160,000 tuples and Orderltem has 200,000 tuples. Both relations store 100 tuples per a page. Consider the following SQL statement SELECT * FROM Item INNER JOIN OrderItem ON Item.ItemID-OrderItem. ItemID; We wish to evaluate an equijoin between Orderltem and Item, with an equality condition Item.ltemID Orderltem.ItemID. There are 802 buffer pages available in memory for this operation. Both relations are stored as (unsorted) heap...
Please explain the questions with detailed explanations. For SQL, do not use inner join. Gives the departments, their ID, name and budget. d stands for department. Employees(eID, dID, eName, eSala e stands for employee ry) Gives the employees, their IDs, where they work, their names and salaries stands for supplier. and where they are located (city and state). Also tells which employees are contact persons for the suppliers Items( ID, siCode dlD, ¡Name, MSRP) | Gives the items and the...