Salaries range from $10,000 to $100,000, ages vary from 20 to 80, each department has about five…


Question Description:

30

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,000,000. 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. Query: Print ename, age, and sal for all employees. (a) Clustered, dense hash index on {ename; age; sal} fields of Emp. (b) Unclustered hash index on {ename; age; sal} fields of Emp. (c) Clustered, sparse B+ tree index on h{ename; age; sal} fields of Emp. (d) Unclustered hash index on {eid; did} fields of Emp. (e) No index.

Answer

30