Problem

Exercise 8.11 Consider the following relations: Emp(eid: integer, ename: varchar, sal: in...

Exercise 8.11 Consider the following relations:

  Emp(eid: integer, ename: varchar, sal: integer, age: integer, did: integer)  Dept(did: integer, budget: integer, floor: integer, mgr_eid: integer)

Salaries range from $10,000 to $100,000, ages vary from 20 to 80, each department has about five employees on average, there are 10 floors, and budgets vary from $10,000 to $1 million. You can assume uniform distributions of values.

For each of the following queries, which of the listed index choices would you choose to speed up the query? If your database system does not consider index-only plans (i.e., data records are always retrieved even if enough information is available in the index entry), how would your answer change? Explain briefly.

  1. Query: Print ename, age, and sal for all employees.
    1. Clustered hash index on 〈ename, age, sal〉 fields of Emp.
    2. Unclustered hash index on 〈ename, age, sal〉 fields of Emp.
    3. Clustered B+ tree index on 〈ename, age, sal〉 fields of Emp.
    4. Unclustered hash index on 〈eid, did〉 fields of Emp.
    5. No index.
  2. Query: Find the dids of departments that are on the 10th floor and have a budgetof less than $15,000.
    1. Clustered hash index on the floor field of Dept.
    2. Unclustered hash index on the floor field of Dept.
    3. Clustered B+ tree index on {floor, budget) fields of Dept.
    4. Clustered B+ tree index on the budget field of Dept.
    5. No index.

Step-by-Step Solution

Request Professional Solution

Request Solution!

We need at least 10 more requests to produce the solution.

0 / 10 have requested this problem solution

The more requests, the faster the answer.

Request! (Login Required)


All students who have requested the solution will be notified once they are available.
Add your Solution
Textbook Solutions and Answers Search
Solutions For Problems in Chapter 8